Skip to content

Commit

Permalink
Merge pull request #792 from zannads/dev-npipes_fix
Browse files Browse the repository at this point in the history
Fix Issue #790 - incorrect number of pipes
  • Loading branch information
LRossman authored May 29, 2024
2 parents ef234a1 + d50c673 commit 9958ef6
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 9958ef6

Please sign in to comment.