mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-17 10:44:48 +00:00
fixed a possible crash in ghostmove
This commit is contained in:
parent
cca689641a
commit
7298c8b71e
2
game.cpp
2
game.cpp
@ -856,7 +856,7 @@ bool ghostmove(eMonster m, cell* to, cell* from) {
|
|||||||
if((m == moWitchGhost || m == moWitchWinter) && to->land != laPower)
|
if((m == moWitchGhost || m == moWitchWinter) && to->land != laPower)
|
||||||
return false;
|
return false;
|
||||||
if(isGhost(m))
|
if(isGhost(m))
|
||||||
for(int i=0; i<to->type; i++) {
|
for(int i=0; i<to->type; i++) if(to->move(i)) {
|
||||||
if(inmirror(to->move(i))) return false;
|
if(inmirror(to->move(i))) return false;
|
||||||
if(to->move(i) && to->move(i) != from && isGhost(to->move(i)->monst) &&
|
if(to->move(i) && to->move(i) != from && isGhost(to->move(i)->monst) &&
|
||||||
(to->move(i)->monst == moFriendlyGhost) == (m== moFriendlyGhost))
|
(to->move(i)->monst == moFriendlyGhost) == (m== moFriendlyGhost))
|
||||||
|
Loading…
Reference in New Issue
Block a user