1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

fixed a possible crash in ghostmove

This commit is contained in:
Zeno Rogue 2019-11-02 20:28:02 +01:00
parent cca689641a
commit 7298c8b71e

View File

@ -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))