From a0f8816de7cce6cef689dc1582d982b848ee6a07 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 13 Apr 2025 09:02:58 +0200 Subject: [PATCH] readd itembox fuse think that was lost somehow lmao --- src/p_mobj.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 002b21df4..8fc0c040d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8775,6 +8775,33 @@ static void P_MonitorFuseThink(mobj_t *mobj) P_RemoveMobj(mobj); // make sure they disappear } +static boolean P_RandomItemFuseThink(mobj_t *mobj) +{ + mobj_t *newmobj; + + if (G_BattleGametype()) + { + if (mobj->threshold != 69) + return false; + } + else + { + // Respawn from mapthing if you have one! + if (mobj->spawnpoint) + { + P_SpawnMapThing(mobj->spawnpoint); + newmobj = mobj->spawnpoint->mobj; // this is set to the new mobj in P_SpawnMapThing + } + else + newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type); + + // Transfer flags2 (strongbox, objectflip) + newmobj->flags2 = mobj->flags2 & ~MF2_DONTDRAW; + } + + return true; +} + static void P_IceBlockFuseThink(mobj_t *mobj) { mobj_t *cur = mobj->hnext, *next; @@ -8845,6 +8872,11 @@ static boolean P_FuseThink(mobj_t *mobj) case MT_QUESTIONBOX: P_MonitorFuseThink(mobj); return false; + case MT_RANDOMITEM: + if (!P_RandomItemFuseThink(mobj)) + break; + P_RemoveMobj(mobj); // make sure they disappear + return false; case MT_METALSONIC_BATTLE: break; // don't remove case MT_SPIKE: