Prevent kicking an object accessing out of map location

This commit is contained in:
Pasi Kallinen
2024-04-25 22:58:37 +03:00
parent 5fa6e6bd8d
commit ab0a98072b

View File

@@ -594,7 +594,8 @@ really_kick_object(coordxy x, coordxy y)
range = 1;
/* see if the object has a place to move into */
if (!ZAP_POS(levl[x + u.dx][y + u.dy].typ)
if (!isok(x + u.dx, y + u.dy)
|| !ZAP_POS(levl[x + u.dx][y + u.dy].typ)
|| closed_door(x + u.dx, y + u.dy))
range = 1;