From 909a9dccc7f4335c7c00a707273a00c12b69fc55 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 29 Dec 2019 02:44:27 -0800 Subject: [PATCH] Don't let us warp to a map that doesn't exist (really!) Okay so 66524a1e3f1f85cd61821d271971e4edea9a5058, I WAS mistaken! Except that's not how you check for a map's existence, at least not how the old map command did it. --- src/g_game.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index e5bbf9d5d..95aa1ae00 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4580,6 +4580,10 @@ INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep) if (usemapcode) { + /* we can't check mapheaderinfo for this hahahaha */ + if (W_CheckNumForName(G_BuildMapName(newmapnum)) == LUMPERROR) + return 0; + if (realmapnamep) (*realmapnamep) = G_BuildMapTitle(newmapnum); }