From 8037431686dfa8752b52345caefcf3f8d8381d19 Mon Sep 17 00:00:00 2001 From: Raf Date: Fri, 30 May 2025 01:25:18 -0300 Subject: [PATCH] port: moved the max explosions config to the .ini file --- port/src/main.c | 1 + src/game/explosionsreset.c | 6 ------ src/game/explosionsstop.c | 2 +- src/game/training.c | 2 +- src/include/constants.h | 1 - 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/port/src/main.c b/port/src/main.c index a622bc078..4b86d300c 100644 --- a/port/src/main.c +++ b/port/src/main.c @@ -169,6 +169,7 @@ PD_CONSTRUCTOR static void gameConfigInit(void) configRegisterInt("Game.SkipIntro", &g_SkipIntro, 0, 1); configRegisterInt("Game.DisableMpDeathMusic", &g_MusicDisableMpDeath, 0, 1); configRegisterInt("Game.GEMuzzleFlashes", &g_BgunGeMuzzleFlashes, 0, 1); + configRegisterInt("Game.MaxExplosions", &g_MaxExplosions, 6, 96); for (s32 j = 0; j < MAX_PLAYERS; ++j) { const s32 i = j + 1; configRegisterFloat(strFmt("Game.Player%d.FovY", i), &g_PlayerExtCfg[j].fovy, 5.f, 175.f); diff --git a/src/game/explosionsreset.c b/src/game/explosionsreset.c index 666f099ca..e3eed9611 100644 --- a/src/game/explosionsreset.c +++ b/src/game/explosionsreset.c @@ -14,12 +14,6 @@ void explosionsReset(void) g_ExplosionShakeIntensityTimer = 0; g_ExplosionDamageTxScale = 1; - g_MaxExplosions = MAX_EXPLOSIONS; - - if (g_Vars.stagenum >= STAGE_TITLE) { - g_MaxExplosions = 0; - } - if (g_MaxExplosions == 0) { g_Explosions = NULL; } else { diff --git a/src/game/explosionsstop.c b/src/game/explosionsstop.c index f23ad575b..c2ef609b1 100644 --- a/src/game/explosionsstop.c +++ b/src/game/explosionsstop.c @@ -14,7 +14,7 @@ void explosionsStop(void) viShake(0); if (g_Explosions) { - for (i = 0; i < MAX_EXPLOSIONS; i++) { + for (i = 0; i < g_MaxExplosions; i++) { if (g_Explosions[i].prop) { propDelist(g_Explosions[i].prop); propDisable(g_Explosions[i].prop); diff --git a/src/game/training.c b/src/game/training.c index 18ccbb18c..5b8e3984f 100644 --- a/src/game/training.c +++ b/src/game/training.c @@ -1544,7 +1544,7 @@ bool frIsAmmoWasted(void) } // Check if there are any explosions - for (i = 0; i != MAX_EXPLOSIONS; i++) { + for (i = 0; i != g_MaxExplosions; i++) { if (g_Explosions[i].prop) { return false; } diff --git a/src/include/constants.h b/src/include/constants.h index 6a77fda41..1c8b41b06 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -18,7 +18,6 @@ #define MAX_CHRSPERSQUADRON 16 #define MAX_CHRSPERTEAM 32 #define MAX_CHRWAYPOINTS 6 -#define MAX_EXPLOSIONS 6 #define MAX_EYESPYDARTS 8 #define MAX_MPCHRS (MAX_PLAYERS + MAX_BOTS) #define MAX_MPPLAYERCONFIGS (MAX_PLAYERS + 2)