Fixes to implement issue #161

This commit is contained in:
Lew Rossman
2018-06-19 10:30:02 -04:00
parent d5194ffb81
commit e9303de078
6 changed files with 25 additions and 1394 deletions

View File

@@ -636,7 +636,8 @@ int controls(EN_Project *pr)
double k1, k2;
char s1, s2;
Slink *link;
Scontrol *control;
EN_Network *net = &pr->network;
time_options_t *top = &pr->time_options;
hydraulics_t *hyd = &pr->hydraulics;
@@ -645,13 +646,13 @@ int controls(EN_Project *pr)
setsum = 0;
for (i=1; i <= net->Ncontrols; i++)
{
Scontrol *control = &net->Control[i];
control = &net->Control[i];
/* Make sure that link is defined */
reset = 0;
if ( (k = control->Link) <= 0) {
continue;
}
link = &net->Link[k];
if ( (k = control->Link) <= 0) {
continue;
}
link = &net->Link[k];
/* Link is controlled by tank level */
if ((n = control->Node) > 0 && n > net->Njuncs)
{