Prevent segfault on nonexistent mapseen
Cannot happen on normal play, but with some lua trickery ...
This commit is contained in:
+4
-1
@@ -3000,6 +3000,8 @@ mapseen_temple(struct monst *priest UNUSED) /* currently unused;
|
|||||||
{
|
{
|
||||||
mapseen *mptr = find_mapseen(&u.uz);
|
mapseen *mptr = find_mapseen(&u.uz);
|
||||||
|
|
||||||
|
if (!mptr)
|
||||||
|
return;
|
||||||
if (Is_valley(&u.uz))
|
if (Is_valley(&u.uz))
|
||||||
mptr->flags.valley = 1;
|
mptr->flags.valley = 1;
|
||||||
else if (Is_sanctum(&u.uz))
|
else if (Is_sanctum(&u.uz))
|
||||||
@@ -3012,7 +3014,8 @@ room_discovered(int roomno)
|
|||||||
{
|
{
|
||||||
mapseen *mptr = find_mapseen(&u.uz);
|
mapseen *mptr = find_mapseen(&u.uz);
|
||||||
|
|
||||||
mptr->msrooms[roomno].seen = 1;
|
if (mptr)
|
||||||
|
mptr->msrooms[roomno].seen = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #overview command */
|
/* #overview command */
|
||||||
|
|||||||
Reference in New Issue
Block a user