From c12f682d63a09f5607a4772db1663bf277923300 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 13 Jan 2018 17:09:26 +0100 Subject: [PATCH] a reference to vector in elec::connect fixed --- complex.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/complex.cpp b/complex.cpp index a4f631b6..3338ade0 100644 --- a/complex.cpp +++ b/complex.cpp @@ -279,9 +279,11 @@ namespace elec { else { int id = size(charges); charges.push_back(chargedata()); - chargedata& ch(charges[id]); + + {chargedata& ch(charges[id]); ch.c = c; ch.otmp = c->aitmp; ch.lowlink = id; c->aitmp = id; ch.instack = true; ch.fire = false; + } // c->landparam = id; // printf("edge %d-%d [%s]\n", from, id, dnameof(c->wall)); @@ -292,11 +294,11 @@ namespace elec { if(chh == ecGrounded) { xstack.push_back(make_pair(id, 0)); - ch.lowlink = 0; + charges[id].lowlink = 0; } else if(chh == ecCharged) { xstack.push_back(make_pair(id, 1)); - if(from != 1) ch.lowlink = 1; + if(from != 1) charges[id].lowlink = 1; } for(int i=0; itype; i++) { @@ -322,7 +324,7 @@ namespace elec { // printf("\n"); } - ch.instack = false; + charges[id].instack = false; } }