mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-21 23:42:36 +00:00
Fix respawning item boxes with P_RespawnBattlesBoxes
This commit is contained in:
parent
81eb513ef1
commit
e7b0e223e1
4 changed files with 35 additions and 36 deletions
|
|
@ -22550,7 +22550,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
MT_RANDOMITEMPOP, // damage
|
MT_RANDOMITEMPOP, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
|
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
|
||||||
S_NULL // raisestate
|
S_RANDOMITEM1 // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_SPHEREBOX
|
{ // MT_SPHEREBOX
|
||||||
|
|
|
||||||
|
|
@ -13199,7 +13199,13 @@ void A_ItemPop(mobj_t *actor)
|
||||||
|
|
||||||
// Here at mapload in battle?
|
// Here at mapload in battle?
|
||||||
if ((gametyperules & GTR_BUMPERS) && (actor->flags2 & MF2_BOSSNOTRAP))
|
if ((gametyperules & GTR_BUMPERS) && (actor->flags2 & MF2_BOSSNOTRAP))
|
||||||
|
{
|
||||||
numgotboxes++;
|
numgotboxes++;
|
||||||
|
|
||||||
|
// do not flicker back in just yet, handled by
|
||||||
|
// P_RespawnBattleBoxes eventually
|
||||||
|
P_SetMobjState(actor, S_INVISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void A_JawzChase(mobj_t *actor)
|
void A_JawzChase(mobj_t *actor)
|
||||||
|
|
|
||||||
|
|
@ -1037,10 +1037,16 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
{
|
{
|
||||||
if (target->flags & MF_MONITOR || target->type == MT_RANDOMITEM)
|
if (target->flags & MF_MONITOR || target->type == MT_RANDOMITEM)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
|
||||||
|
|
||||||
P_SetTarget(&target->target, source);
|
P_SetTarget(&target->target, source);
|
||||||
|
|
||||||
|
if (gametyperules & GTR_BUMPERS)
|
||||||
|
{
|
||||||
|
target->fuse = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (&players[i] == source->player)
|
if (&players[i] == source->player)
|
||||||
|
|
@ -1061,6 +1067,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if a player avatar dies...
|
// if a player avatar dies...
|
||||||
if (target->player)
|
if (target->player)
|
||||||
|
|
|
||||||
24
src/p_mobj.c
24
src/p_mobj.c
|
|
@ -9229,7 +9229,7 @@ static boolean P_FuseThink(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
else if ((gametyperules & GTR_BUMPERS) && (mobj->threshold != 70))
|
else if ((gametyperules & GTR_BUMPERS) && (mobj->state == &states[S_INVISIBLE]))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -11072,7 +11072,6 @@ void P_RespawnBattleBoxes(void)
|
||||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||||
{
|
{
|
||||||
mobj_t *box;
|
mobj_t *box;
|
||||||
mobj_t *newmobj;
|
|
||||||
|
|
||||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -11081,25 +11080,12 @@ void P_RespawnBattleBoxes(void)
|
||||||
|
|
||||||
if (box->type != MT_RANDOMITEM
|
if (box->type != MT_RANDOMITEM
|
||||||
|| (box->flags2 & MF2_DONTRESPAWN)
|
|| (box->flags2 & MF2_DONTRESPAWN)
|
||||||
|| box->threshold != 68
|
|| box->health > 0
|
||||||
|| box->fuse
|
|| box->fuse)
|
||||||
|| ((tic_t)box->cvmem+1 >= leveltime))
|
|
||||||
continue; // only popped items
|
continue; // only popped items
|
||||||
|
|
||||||
// Respawn from mapthing if you have one!
|
box->fuse = TICRATE; // flicker back in (A_ItemPop preps this effect)
|
||||||
if (box->spawnpoint)
|
P_SetMobjState(box, box->info->raisestate);
|
||||||
{
|
|
||||||
P_SpawnMapThing(box->spawnpoint);
|
|
||||||
newmobj = box->spawnpoint->mobj; // this is set to the new mobj in P_SpawnMapThing
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newmobj = P_SpawnMobj(box->x, box->y, box->z, box->type);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transfer flags2 (strongbox, objectflip, bossnotrap)
|
|
||||||
newmobj->flags2 = box->flags2;
|
|
||||||
P_RemoveMobj(box); // make sure they disappear
|
|
||||||
|
|
||||||
if (numgotboxes > 0)
|
if (numgotboxes > 0)
|
||||||
numgotboxes--; // you've restored a box, remove it from the count
|
numgotboxes--; // you've restored a box, remove it from the count
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue