mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-04 14:30:35 +00:00
fixed a crash when jumping on an Orb of Safety
This commit is contained in:
parent
ef7a8b6f76
commit
c117b0e2d0
8
orbs.cpp
8
orbs.cpp
@ -601,6 +601,12 @@ void jumpTo(cell *dest, eItem byWhat, int bonuskill, eMonster dashmon) {
|
|||||||
sword::reset();
|
sword::reset();
|
||||||
stabbingAttack(c1, dest, moPlayer, bonuskill);
|
stabbingAttack(c1, dest, moPlayer, bonuskill);
|
||||||
playerMoveEffects(c1, dest);
|
playerMoveEffects(c1, dest);
|
||||||
|
|
||||||
|
// do not apply movecost later, when from no longer exists
|
||||||
|
if(cwt.at->item == itOrbSafety) {
|
||||||
|
movecost(from, dest, 2);
|
||||||
|
from = NULL;
|
||||||
|
}
|
||||||
if(cwt.at->item != itOrbYendor && cwt.at->item != itHolyGrail)
|
if(cwt.at->item != itOrbYendor && cwt.at->item != itHolyGrail)
|
||||||
collectItem(cwt.at, true);
|
collectItem(cwt.at, true);
|
||||||
|
|
||||||
@ -609,7 +615,7 @@ void jumpTo(cell *dest, eItem byWhat, int bonuskill, eMonster dashmon) {
|
|||||||
for(int i=9; i>=0; i--)
|
for(int i=9; i>=0; i--)
|
||||||
setdist(cwt.at, i, NULL);
|
setdist(cwt.at, i, NULL);
|
||||||
|
|
||||||
movecost(from, dest, 2);
|
if(from) movecost(from, dest, 2);
|
||||||
|
|
||||||
createNoise(1);
|
createNoise(1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user