Fix visual type desync on respawned battle items

This commit is contained in:
AJ Martinez 2023-10-15 18:03:53 -07:00
parent 2e1983dd7f
commit 53a001da08
2 changed files with 5 additions and 5 deletions

View file

@ -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;

View file

@ -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);