"no monster to remove" for steed knockback
Reported directly to devteam, mounted hero whose steed got hit for knockback effect triggered impossible "no monster to remove". In addition to fixing that, this makes a knockback attempt at a hero who is stuck to a cursed saddle knock the hero and steed back instead of knocking the hero out of the saddle. mhurtle_step() should be able to use u.ux0,u.uy0 to update the hero's old location after moving the hero in order to move the steed, but the value was different from what was expected and the map showed stale steed symbol when I used that. I'm not sure what is going on there; saving u.ux,u.uy before moving the hero worked as intended so I didn't pursue it.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 dothrow.c $NHDT-Date: 1645298658 2022/02/19 19:24:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.217 $ */
|
||||
/* NetHack 3.7 dothrow.c $NHDT-Date: 1664966382 2022/10/05 10:39:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.249 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -955,10 +955,22 @@ mhurtle_step(genericptr_t arg, coordxy x, coordxy y)
|
||||
&& m_in_out_region(mon, x, y)) {
|
||||
int res;
|
||||
|
||||
remove_monster(mon->mx, mon->my);
|
||||
newsym(mon->mx, mon->my);
|
||||
place_monster(mon, x, y);
|
||||
newsym(mon->mx, mon->my);
|
||||
if (mon != u.usteed) {
|
||||
remove_monster(mon->mx, mon->my);
|
||||
newsym(mon->mx, mon->my);
|
||||
place_monster(mon, x, y);
|
||||
newsym(mon->mx, mon->my);
|
||||
} else {
|
||||
/* steed is hurtling, move hero which will also move steed */
|
||||
coordxy oldx = u.ux, oldy = u.uy;
|
||||
|
||||
u_on_newpos(x, y);
|
||||
/* for some reason u.ux0,u.uy0 haven't been reliable here */
|
||||
newsym(oldx, oldy); /* update old position */
|
||||
vision_recalc(0); /* new location => different lines of sight */
|
||||
}
|
||||
flush_screen(1);
|
||||
delay_output();
|
||||
set_apparxy(mon);
|
||||
if (is_waterwall(x, y))
|
||||
return FALSE;
|
||||
@@ -967,9 +979,6 @@ mhurtle_step(genericptr_t arg, coordxy x, coordxy y)
|
||||
|| res == Trap_Caught_Mon
|
||||
|| res == Trap_Moved_Mon)
|
||||
return FALSE;
|
||||
|
||||
flush_screen(1);
|
||||
delay_output();
|
||||
return TRUE;
|
||||
}
|
||||
if ((mtmp = m_at(x, y)) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user