From: Pasi Kallinen Date: Fri, 11 Nov 2016 16:18:55 +0000 (+0200) Subject: Sanity check for returning Mjollnir animation X-Git-Tag: NetHack-3.6.1_RC01~556 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=897916f921629057e5f103e10ff24a4feebf40a2;p=nethack Sanity check for returning Mjollnir animation --- diff --git a/src/dothrow.c b/src/dothrow.c index 98d41de9e..769be9370 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -985,11 +985,11 @@ sho_obj_return_to_u(obj) struct obj *obj; { /* might already be our location (bounced off a wall) */ - if (bhitpos.x != u.ux || bhitpos.y != u.uy) { + if ((u.dx || u.dy) && (bhitpos.x != u.ux || bhitpos.y != u.uy)) { int x = bhitpos.x - u.dx, y = bhitpos.y - u.dy; tmp_at(DISP_FLASH, obj_to_glyph(obj)); - while (x != u.ux || y != u.uy) { + while (isok(x,y) && (x != u.ux || y != u.uy)) { tmp_at(x, y); delay_output(); x -= u.dx;