mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
fixed unitialized sword variables in stalemate for non-players
This commit is contained in:
parent
9a58f0a001
commit
87ef9a68e3
7
game.cpp
7
game.cpp
@ -1363,7 +1363,8 @@ int monstersnear(cell *c, cell *nocount, eMonster who, cell *pushto, cell *comef
|
||||
who == moPlayer ? sword::shift(comefrom, c, sword::angle[multi::cpid]) :
|
||||
sword::angle[multi::cpid]);
|
||||
|
||||
if(who == moPlayer) for(int b=0; b<2; b++) {
|
||||
for(int b=0; b<2; b++) {
|
||||
if(who == moPlayer) {
|
||||
sm.swordnext[b] = sword::pos(multi::cpid, b);
|
||||
sm.swordtransit[b] = NULL;
|
||||
if(sm.swordnext[b] && sm.swordnext[b] != sm.swordlast[b] && !isNeighbor(sm.swordlast[b], sm.swordnext[b])) {
|
||||
@ -1376,6 +1377,10 @@ int monstersnear(cell *c, cell *nocount, eMonster who, cell *pushto, cell *comef
|
||||
sm.swordtransit[b] = c2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sm.swordnext[b] = sm.swordtransit[b] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
stalemate::moves.push_back(sm);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user