Adds get/set for default demand pattern to toolkit

This commit is contained in:
Lew Rossman
2022-01-14 08:50:33 -05:00
parent 64f0d15afe
commit afda609223
6 changed files with 22 additions and 14 deletions

View File

@@ -485,6 +485,8 @@ void demands(Project *pr)
{
// pattern period (k) = (elapsed periods) modulus (periods per pattern)
j = demand->Pat;
if (j == 0)
j = hyd->DefPat;
k = p % (long)net->Pattern[j].Length;
djunc = (demand->Base) * net->Pattern[j].F[k] * hyd->Dmult;
if (djunc > 0.0) hyd->Dsystem += djunc;