diff --git a/src/objects/random-item.c b/src/objects/random-item.c index ecd5ee27f..b2dcc31fe 100644 --- a/src/objects/random-item.c +++ b/src/objects/random-item.c @@ -125,10 +125,7 @@ void Obj_RandomItemVisuals(mobj_t *mobj) { 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) + if (mobj->extravalue1 == RINGBOX_TIME || specialstageinfo.valid) { // Sync the position in RINGBOX and RANDOMITEM animations. statenum_t animDelta = mobj->state - states - S_RINGBOX1; diff --git a/src/p_inter.c b/src/p_inter.c index 327b452ed..78ec9864e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -412,7 +412,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_SetTarget(&special->target, toucher); P_UpdateLastPickup(player, cheesetype); // P_KillMobj(special, toucher, toucher, DMG_NORMAL); - if (special->extravalue1 >= RINGBOX_TIME) + + statenum_t specialstate = special->state - states; + + if (specialstate >= S_RANDOMITEM1 && specialstate <= S_RANDOMITEM12) K_StartItemRoulette(player, false); else K_StartItemRoulette(player, true);