From 472cb7f7fa7b614f2f3afeceaf56b3abef2ab1c8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 25 Apr 2024 12:39:02 +0300 Subject: [PATCH] Prevent throwing gold out of the map --- src/dothrow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dothrow.c b/src/dothrow.c index c1afb4b29..da634c810 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -2645,7 +2645,7 @@ throw_gold(struct obj *obj) /* see if the gold has a place to move into */ odx = u.ux + u.dx; ody = u.uy + u.dy; - if (!ZAP_POS(levl[odx][ody].typ) || closed_door(odx, ody)) { + if (!isok(odx, ody) || !ZAP_POS(levl[odx][ody].typ) || closed_door(odx, ody)) { gb.bhitpos.x = u.ux; gb.bhitpos.y = u.uy; } else {