Restore old behavior for running onto trap

The refactor of domove made it impossible to run onto a trap (or water,
if blind), even in the shift-dir mode where the hero is meant to stop
only upon "hitting a wall or running into something".  I use this
runmode to sprint large distances across the map, and the change to this
behavior meant that it was no longer possible to press shift-dir again
to continue past the trap.  This restores the old behavior of allowing
shift-dir running to carry you onto a trap (though the hero will still
stop before hitting a trap in less breakneck runmodes).
This commit is contained in:
Michael Meyer
2022-07-28 11:48:05 -04:00
committed by Pasi Kallinen
parent 9d28a8dc76
commit ce0107aff9

View File

@@ -2149,18 +2149,16 @@ avoid_moving_on_liquid(
static boolean
avoid_running_into_trap_or_liquid(coordxy x, coordxy y)
{
boolean would_stop = (g.context.run >= 2);
if (!g.context.run)
return FALSE;
if (avoid_moving_on_trap(x,y, TRUE)) {
if (avoid_moving_on_trap(x,y, would_stop)
|| (Blind && avoid_moving_on_liquid(x,y, would_stop))) {
nomul(0);
g.context.move = 0;
return TRUE;
}
if (Blind && avoid_moving_on_liquid(x,y, TRUE)) {
nomul(0);
g.context.move = 0;
return TRUE;
if (would_stop)
g.context.move = 0;
return would_stop;
}
return FALSE;
}