From c117b0e2d01f10178ef1db03f2b9a1179b90d7ac Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 19 Nov 2018 22:22:16 +0100 Subject: [PATCH] fixed a crash when jumping on an Orb of Safety --- orbs.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/orbs.cpp b/orbs.cpp index e480295e..077f26c6 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -597,10 +597,16 @@ void jumpTo(cell *dest, eItem byWhat, int bonuskill, eMonster dashmon) { flipplayer = true; } countLocalTreasure(); - + sword::reset(); stabbingAttack(c1, dest, moPlayer, bonuskill); 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) collectItem(cwt.at, true); @@ -609,8 +615,8 @@ void jumpTo(cell *dest, eItem byWhat, int bonuskill, eMonster dashmon) { for(int i=9; i>=0; i--) setdist(cwt.at, i, NULL); - movecost(from, dest, 2); - + if(from) movecost(from, dest, 2); + createNoise(1); if(shmup::on)