Fix random attended shrines in irregular rooms
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user