1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-31 19:36:16 +00:00

a reference to vector in elec::connect fixed

This commit is contained in:
Zeno Rogue 2018-01-13 17:09:26 +01:00
parent f82c07e5a6
commit c12f682d63

View File

@ -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; i<c->type; i++) {
@ -322,7 +324,7 @@ namespace elec {
// printf("\n");
}
ch.instack = false;
charges[id].instack = false;
}
}