Prevent segfault trying to make non-existent trap seen

This commit is contained in:
Pasi Kallinen
2022-03-01 15:31:22 +02:00
parent d63b59e6a1
commit 473ae4a6a0

View File

@@ -1468,7 +1468,7 @@ mktrap(int num, int mktrapflags, struct mkroom *croom, coord *tm)
if (kind == WEB && !(mktrapflags & MKTRAP_NOSPIDERONWEB))
(void) makemon(&mons[PM_GIANT_SPIDER], m.x, m.y, NO_MM_FLAGS);
if ((mktrapflags & MKTRAP_SEEN))
if (t && (mktrapflags & MKTRAP_SEEN))
t->tseen = TRUE;
/* The hero isn't the only person who's entered the dungeon in