Fixes incorrect hour set with >9 input tokens
If you create a simple control with nine or more input tokens, the logic skips over assigning the hour variable and EPANET will activate the control at hour zero.
This commit is contained in:
@@ -922,7 +922,7 @@ int controldata(Project *pr)
|
|||||||
case TIMER:
|
case TIMER:
|
||||||
case TIMEOFDAY:
|
case TIMEOFDAY:
|
||||||
if (n == 6) time = hour(parser->Tok[5], "");
|
if (n == 6) time = hour(parser->Tok[5], "");
|
||||||
if (n == 7) time = hour(parser->Tok[5], parser->Tok[6]);
|
if (n >= 7) time = hour(parser->Tok[5], parser->Tok[6]);
|
||||||
if (time < 0.0) return setError(parser, 5, 213);
|
if (time < 0.0) return setError(parser, 5, 213);
|
||||||
break;
|
break;
|
||||||
case LOWLEVEL:
|
case LOWLEVEL:
|
||||||
|
|||||||
Reference in New Issue
Block a user