]> granicus.if.org Git - nethack/commitdiff
Sanity check for returning Mjollnir animation
authorPasi Kallinen <paxed@alt.org>
Fri, 11 Nov 2016 16:18:55 +0000 (18:18 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 11 Nov 2016 16:18:55 +0000 (18:18 +0200)
src/dothrow.c

index 98d41de9ef8e794f42aa567aa85d18c02d9d3253..769be93708cca049792d0f5d8fe9d582f41af00d 100644 (file)
@@ -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;