Adjust Trace Node index when node deleted
This commit is contained in:
@@ -1996,6 +1996,7 @@ int DLLEXPORT EN_deletenode(EN_Project p, int index, int actionCode)
|
||||
*/
|
||||
{
|
||||
Network *net = &p->network;
|
||||
Quality *qual = &p->quality;
|
||||
|
||||
int i, nodeType, tankindex;
|
||||
Snode *node;
|
||||
@@ -2042,6 +2043,9 @@ int DLLEXPORT EN_deletenode(EN_Project p, int index, int actionCode)
|
||||
hashtable_update(net->NodeHashTable, net->Node[i].ID, i);
|
||||
}
|
||||
|
||||
// Adjust index of water quality trace node
|
||||
if (qual->TraceNode > index) qual->TraceNode -= 1;
|
||||
|
||||
// If deleted node is a tank, remove it from the Tank array
|
||||
if (nodeType != EN_JUNCTION)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user