diff --git a/src/objects/random-item.c b/src/objects/random-item.c index 5e07c6de5..a5db705f6 100644 --- a/src/objects/random-item.c +++ b/src/objects/random-item.c @@ -18,6 +18,7 @@ #include "../r_defs.h" #include "../k_battle.h" #include "../m_random.h" +#include "../k_specialstage.h" // specialstageinfo #define FLOAT_HEIGHT ( 12 * FRACUNIT ) #define FLOAT_TIME ( 2 * TICRATE ) @@ -114,10 +115,14 @@ void Obj_RandomItemVisuals(mobj_t *mobj) // the player's cleared out a good portion of the map. // // Then extraval1 starts ticking up and triggers the transformation from Ringbox to Random Item. - if (mobj->fuse == 0 && !(mobj->flags & MF_NOCLIPTHING) && !(mobj->flags2 & MF2_AMBUSH) - && !cv_thunderdome.value && !(modeattacking & ATTACKING_SPB)) + if (mobj->fuse == 0 && !(mobj->flags & MF_NOCLIPTHING) && !(mobj->flags2 & MF2_AMBUSH) && !cv_thunderdome.value + && (modeattacking == 0 || specialstageinfo.valid)) // Time Attacking in Special is a fucked-looking exception { mobj->extravalue1++; + + if (specialstageinfo.valid) // Setting the timer in this case probably looks kinda goofy, but P_ItemPop checks xval1, not states. + mobj->extravalue1 = max(mobj->extravalue1, RINGBOX_TIME); // I will change this if this logic ever becomes even slightly more complicated. + if (mobj->extravalue1 == RINGBOX_TIME) { // Sync the position in RINGBOX and RANDOMITEM animations. @@ -125,7 +130,6 @@ void Obj_RandomItemVisuals(mobj_t *mobj) P_SetMobjState(mobj, S_RANDOMITEM1 + (animDelta%12)); } } - } boolean Obj_RandomItemSpawnIn(mobj_t *mobj) diff --git a/src/p_inter.c b/src/p_inter.c index e779150cc..fb21ddac8 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -207,7 +207,8 @@ static void P_ItemPop(mobj_t *actor) Obj_SpawnItemDebrisEffects(actor, actor->target); - P_SetMobjState(actor, S_RINGBOX1); + if (!specialstageinfo.valid) // In Special, you'll respawn as a Ring Box (random-item.c), don't confuse the player. + P_SetMobjState(actor, S_RINGBOX1); actor->extravalue1 = 0; // de-solidify