mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
check_vault: ensure error codes don't depend on angle
This commit is contained in:
parent
77f6d2db14
commit
8d98193e70
6
orbs.cpp
6
orbs.cpp
@ -1230,11 +1230,11 @@ EX int check_vault(cell *cf, cell *ct, flagtype flags, cell*& jumpthru) {
|
|||||||
}
|
}
|
||||||
jumpthru = c2;
|
jumpthru = c2;
|
||||||
if(!c2) return 0;
|
if(!c2) return 0;
|
||||||
|
if(c3) return 1;
|
||||||
bool cutwall = among(c2->wall, waShrub, waExplosiveBarrel, waSmallTree, waBigTree);
|
bool cutwall = among(c2->wall, waShrub, waExplosiveBarrel, waSmallTree, waBigTree);
|
||||||
if(!c2->monst && !cutwall) return 1;
|
if(!c2->monst && !cutwall) return 2;
|
||||||
bool for_monster = !(flags & P_ISPLAYER);
|
bool for_monster = !(flags & P_ISPLAYER);
|
||||||
if(for_monster && c2->monst && frog_power(c2->monst) && !items[itOrbDiscord]) return 1;
|
if(for_monster && c2->monst && frog_power(c2->monst) && !items[itOrbDiscord]) return 2;
|
||||||
if(c3) return 2;
|
|
||||||
if(!cutwall && !passable(c2, cwt.at, flags | P_JUMP1 | P_MONSTER)) return 3;
|
if(!cutwall && !passable(c2, cwt.at, flags | P_JUMP1 | P_MONSTER)) return 3;
|
||||||
if(!passable(ct, c2, flags | P_JUMP2)) return 4;
|
if(!passable(ct, c2, flags | P_JUMP2)) return 4;
|
||||||
if(!cutwall && !canAttack(cwt.at, moPlayer, c2, c2->monst, 0)) return 5;
|
if(!cutwall && !canAttack(cwt.at, moPlayer, c2, c2->monst, 0)) return 5;
|
||||||
|
Loading…
Reference in New Issue
Block a user