diff --git a/doc/fixes5-0-1.txt b/doc/fixes5-0-1.txt index 175061880..fa287d1ee 100644 --- a/doc/fixes5-0-1.txt +++ b/doc/fixes5-0-1.txt @@ -24,6 +24,7 @@ obey statue type gender (gnome king statue in minetn-5) fix statue and figurine genders in special levels in general fix buffer overflow in update_topl when handling multiple items in a container +fix random attended shrines in irregular rooms Platform- and/or Interface-Specific Fixes diff --git a/src/mkroom.c b/src/mkroom.c index dd9fa8468..f1a0cfb35 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -573,6 +573,8 @@ mkswamp(void) /* Michiel Huisjes & Fred de Wilde */ } } +/* return center of room, or a random free location + if center is blocked */ staticfn coord * shrine_pos(int roomno) { @@ -591,6 +593,14 @@ shrine_pos(int roomno) buf.y = troom->ly + delta / 2; if ((delta % 2) && rn2(2)) buf.y++; + + /* irregular room or the location is blocked */ + if (roomno != levl[buf.x][buf.y].roomno + || (levl[buf.x][buf.y].typ != ROOM + && levl[buf.x][buf.y].typ != ICE + && levl[buf.x][buf.y].typ != CLOUD)) + (void) somexyspace(troom, &buf); + return &buf; }