From a46036e489f55b6840674265df75a65801f82bd6 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 23 Sep 2019 08:50:59 -0400 Subject: [PATCH] Last few magic numbers I could find --- src/d_clisrv.h | 2 +- src/dehacked.c | 4 ++-- src/m_menu.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 87147aeb8..013ccca01 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -325,7 +325,7 @@ typedef struct UINT8 gametype; UINT8 modifiedgame; SINT8 adminplayers[MAXPLAYERS]; // Needs to be signed - UINT16 powerlevels[MAXPLAYERS][2]; // SRB2kart: player power levels + UINT16 powerlevels[MAXPLAYERS][PWRLV_NUMTYPES]; // SRB2kart: player power levels char server_context[8]; // Unique context id, generated at server startup. diff --git a/src/dehacked.c b/src/dehacked.c index 383183a0f..b8f292a69 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2559,9 +2559,9 @@ static void readcondition(UINT8 set, UINT32 id, char *word2) re = atoi(params[1]); x1 = atoi(params[2]); - if (x1 < 0 || x1 > 1) + if (x1 < 0 || x1 >= PWRLV_NUMTYPES) { - deh_warning("Power level type %d out of range (0 - 1)", x1); + deh_warning("Power level type %d out of range (0 - %d)", x1, PWRLV_NUMTYPES-1); return; } } diff --git a/src/m_menu.c b/src/m_menu.c index 362c7ea5c..9f4c3cda5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6211,7 +6211,7 @@ static char *M_GetConditionString(condition_t cond) case UC_MATCHESPLAYED: return va("Play %d matches", cond.requirement); case UC_POWERLEVEL: - return va("Reach power level %d in %s", cond.requirement, (cond.extrainfo1 == 1 ? "Battle" : "Race")); + return va("Reach power level %d in %s", cond.requirement, (cond.extrainfo1 == PWRLV_BATTLE ? "Battle" : "Race")); case UC_GAMECLEAR: if (cond.requirement > 1) return va("Beat game %d times", cond.requirement);