]> granicus.if.org Git - nethack/commitdiff
Fix missing Izchak shop
authorPasi Kallinen <paxed@alt.org>
Sat, 24 Jul 2021 17:18:40 +0000 (20:18 +0300)
committerPasi Kallinen <paxed@alt.org>
Sat, 24 Jul 2021 17:18:44 +0000 (20:18 +0300)
My recent commit broke Izchak's shop in minetn-6.
Fix it as per the suggestion from entrez.
Fixes #555

src/sp_lev.c

index b0659c2719fa9448a043afca81492cb82c2c3fc1..7cd2cd108a1ca2f2888f10bebb2f37fa767c9a64 100755 (executable)
@@ -981,13 +981,13 @@ shared_with_room(int x, int y, struct mkroom *droom)
         return FALSE;
     if ((int) levl[x][y].roomno == rmno && !levl[x][y].edge)
         return FALSE;
-    if (isok(x-1, y) && (int) levl[x-1][y].roomno == rmno)
+    if (isok(x-1, y) && (int) levl[x-1][y].roomno == rmno && x-1 <= droom->hx)
         return TRUE;
-    if (isok(x+1, y) && (int) levl[x+1][y].roomno == rmno)
+    if (isok(x+1, y) && (int) levl[x+1][y].roomno == rmno && x+1 >= droom->lx)
         return TRUE;
-    if (isok(x, y-1) && (int) levl[x][y-1].roomno == rmno)
+    if (isok(x, y-1) && (int) levl[x][y-1].roomno == rmno && y-1 <= droom->hy)
         return TRUE;
-    if (isok(x, y+1) && (int) levl[x][y+1].roomno == rmno)
+    if (isok(x, y+1) && (int) levl[x][y+1].roomno == rmno && y+1 >= droom->ly)
         return TRUE;
     return FALSE;
 }