fix pull request #340 - untrap steed sanity

When a failed #untrap attempt while mounted caused hero to be moved
onto the trap, it neglected to set the steed's coordinates to match.
If 'sanity_check' was On, that would trigger warnings about steed's
anomalous position.  Eventually a normal move would put steed's
coordinates back in sync with the hero's.

The pull request code set u.usteed->{mx,my} directly.  I've used
u_on_newpos() instead.  I also replaced some direct manipulations of
u.{ux,uy} with u_on_newpos() so that if clipping is in effect it will
be updated.

Fixes #340
This commit is contained in:
PatR
2020-04-27 11:48:55 -07:00
parent c17301a75c
commit 54cfb86936
3 changed files with 14 additions and 6 deletions

View File

@@ -4035,7 +4035,8 @@ struct trap *ttmp;
if (!Punished
|| drag_ball(x, y, &bc, &bx, &by, &cx, &cy, &unused, TRUE)) {
u.ux0 = u.ux, u.uy0 = u.uy;
u.ux = x, u.uy = y;
/* set u.ux,u.uy and u.usteed->mx,my plus handle CLIPPING */
u_on_newpos(x, y);
u.umoved = TRUE;
newsym(u.ux0, u.uy0);
vision_recalc(1);