From a76cc51ac8d217be4c2a969a6be8965cf72d5d1a Mon Sep 17 00:00:00 2001 From: Lew Rossman Date: Thu, 5 Nov 2020 21:54:10 -0500 Subject: [PATCH] Allow negative EN_SETTING value in EN_setlinkvalue Makes EN_setlinkvalue consistent with how an input file is read. This addresses issue #616 . --- src/epanet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/epanet.c b/src/epanet.c index 0f6fb12..e249e1b 100644 --- a/src/epanet.c +++ b/src/epanet.c @@ -3886,7 +3886,6 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu case EN_INITSETTING: case EN_SETTING: - if (value < 0.0) return 211; if (Link[index].Type == PIPE || Link[index].Type == CVPIPE) { return EN_setlinkvalue(p, index, EN_ROUGHNESS, value); @@ -3896,6 +3895,7 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu switch (Link[index].Type) { case PUMP: + if (value < 0.0) return 211; break; case PRV: case PSV: