From 82b60cc5855c2e28a5d5afd59c4dc251da03cf76 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 2 Jun 2023 20:27:38 +0100 Subject: [PATCH] Map types: Make more map ID types consistent as UINT16 - nextmap - prevmap - nextmapoverride - G_GetFirstMapOfGametype --- src/doomstat.h | 2 +- src/g_game.c | 10 +++++----- src/g_game.h | 4 ++-- src/menus/transient/level-select.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 619f01db3..c5b594e8d 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -343,7 +343,7 @@ struct textprompt_t extern textprompt_t *textprompts[MAX_PROMPTS]; // For the Custom Exit linedef. -extern INT16 nextmapoverride; +extern UINT16 nextmapoverride; extern UINT8 skipstats; // Fun extra stuff diff --git a/src/g_game.c b/src/g_game.c index f65f0ba6d..d940cbb46 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -183,7 +183,7 @@ boolean exitfadestarted = false; cutscene_t *cutscenes[128]; textprompt_t *textprompts[MAX_PROMPTS]; -INT16 nextmapoverride; +UINT16 nextmapoverride; UINT8 skipstats; // Pointers to each CTF flag @@ -332,7 +332,7 @@ typedef struct joystickvector2_s boolean precache = true; // if true, load all graphics at start -INT16 prevmap, nextmap; +UINT16 prevmap, nextmap; static void weaponPrefChange(void); static void weaponPrefChange2(void); @@ -3717,10 +3717,10 @@ UINT32 G_TOLFlag(INT32 pgametype) return 0; } -INT16 G_GetFirstMapOfGametype(UINT8 pgametype) +UINT16 G_GetFirstMapOfGametype(UINT8 pgametype) { UINT8 i = 0; - INT16 mapnum = NEXTMAP_INVALID; + UINT16 mapnum = NEXTMAP_INVALID; levelsearch_t templevelsearch; templevelsearch.cup = NULL; @@ -4181,7 +4181,7 @@ static void G_GetNextMap(void) // nextmap is 0-based, unlike gamemap if (nextmapoverride != 0) { - nextmap = (INT16)(nextmapoverride-1); + nextmap = (nextmapoverride-1); setalready = true; } else if (roundqueue.size > 0) diff --git a/src/g_game.h b/src/g_game.h index 2f498134e..34cfbd514 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -38,7 +38,7 @@ extern boolean playeringame[MAXPLAYERS]; extern tic_t levelstarttic; // for modding? -extern INT16 prevmap, nextmap; +extern UINT16 prevmap, nextmap; // see also G_MapNumber typedef enum @@ -276,7 +276,7 @@ FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics); // Don't split up TOL handling UINT32 G_TOLFlag(INT32 pgametype); -INT16 G_GetFirstMapOfGametype(UINT8 pgametype); +UINT16 G_GetFirstMapOfGametype(UINT8 pgametype); UINT16 G_RandMap(UINT32 tolflags, UINT16 pprevmap, boolean ignoreBuffers, boolean callAgainSoon, UINT16 *extBuffer); void G_AddMapToBuffer(UINT16 map); diff --git a/src/menus/transient/level-select.c b/src/menus/transient/level-select.c index 2aeb50f55..68d395abf 100644 --- a/src/menus/transient/level-select.c +++ b/src/menus/transient/level-select.c @@ -131,7 +131,7 @@ UINT16 M_CountLevelsToShowInList(levelsearch_t *levelsearch) UINT16 M_GetFirstLevelInList(UINT8 *i, levelsearch_t *levelsearch) { - INT16 mapnum = NEXTMAP_INVALID; + UINT16 mapnum = NEXTMAP_INVALID; if (!levelsearch) return NEXTMAP_INVALID;