From 5834d6ea5a827fd3fd9b5792c3bd50c741c8bea5 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Thu, 2 Oct 2025 15:46:58 -0400 Subject: [PATCH] Fix battlemode item boxes not respawning (closes #135) --- src/k_battle.c | 1 - src/p_mobj.c | 1 - src/p_setup.c | 3 +++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/k_battle.c b/src/k_battle.c index 044930e29..86eddeb3f 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -572,7 +572,6 @@ void K_RespawnBattleBoxes(void) newmobj->flags2 = box->flags2; P_RemoveMobj(box); // make sure they disappear numgotboxes--; // you've restored a box, remove it from the count - //continue; -- irrelevant? } if (numgotboxes < 0) diff --git a/src/p_mobj.c b/src/p_mobj.c index 53d735643..b4ed6b795 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -13686,7 +13686,6 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean case MT_RANDOMITEM: { mobj->flags2 |= MF2_BOSSNOTRAP; // mark as here on map start - nummapboxes++; break; } case MT_ITEMCAPSULE: diff --git a/src/p_setup.c b/src/p_setup.c index 99c182af1..4dbb56985 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -782,6 +782,9 @@ static void P_SpawnMapThings(boolean spawnemblems) if (!spawnemblems && mt->type == mobjinfo[MT_EMBLEM].doomednum) continue; + if (mt->type == mobjinfo[MT_RANDOMITEM].doomednum) + nummapboxes++; + // Don't spawn non-patch objects of this type if they are uneeded if (mt->patch == false && basemaptyperemoval[mt->type] == true) continue;