Skip to content

Commit

Permalink
Fix Issue #790 - incorrect number of pipes
Browse files Browse the repository at this point in the history
The pipe counter was not decreased if the element was a pipe.
  • Loading branch information
zannads committed May 23, 2024
1 parent ef234a1 commit d50c673
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/epanet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3408,6 +3408,12 @@ int DLLEXPORT EN_deletelink(EN_Project p, int index, int actionCode)
if (net->Valve[i].Link > index) net->Valve[i].Link -= 1;
}

// Reduce the number of pipes count by one if it is a pipe.
if (linkType == PIPE)
{
net->Npipes--;
}

// Delete any pump associated with the deleted link
if (linkType == PUMP)
{
Expand Down

0 comments on commit d50c673

Please sign in to comment.