Add ENsetlinknodes to DEF file and add a function check

This commit is contained in:
Elad Salomons
2018-10-29 17:20:45 +02:00
parent 1234c7e685
commit 4394c53f9b
2 changed files with 4 additions and 0 deletions

View File

@@ -3169,6 +3169,9 @@ int DLLEXPORT EN_setlinknodes(EN_ProjectHandle ph, int index, int node1, int nod
int type;
EN_Project *p = (EN_Project*)ph;
EN_Network *net = &p->network;
// Check that end and start nodes are not the same
if (node1 == node2) return set_error(p->error_handle, 222);
// Check that nodes exist
if (node1 < 0 || node1 > net->Nnodes) return set_error(p->error_handle, 203);