Limit demand deficit to be >= 0

This commit is contained in:
Lew Rossman
2025-03-19 18:37:34 -04:00
parent 06284bb218
commit fff984d6be
2 changed files with 2 additions and 1 deletions

View File

@@ -2380,6 +2380,7 @@ int DLLEXPORT EN_getnodevalue(EN_Project p, int index, int property, double *val
// while DemandFlow contains delivered consumer demand
if (hyd->FullDemand[index] <= 0.0) return 0;
v = (hyd->FullDemand[index] - hyd->DemandFlow[index]) * Ucf[FLOW];
if (v < 0.0) v = 0.0;
break;
case EN_NODE_INCONTROL: