Sanity check for returning Mjollnir animation

This commit is contained in:
Pasi Kallinen
2016-11-11 18:18:55 +02:00
parent f4acfd7995
commit 897916f921

View 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;