revert some mobj stuff i forgor about
This commit is contained in:
1 parent
9cf3eb1631
commit
4041a93ae5
5 files changed
+19
-36
No files matched your search
@@ -3078,16 +3078,9 @@ void CL_ClearPlayer(INT32 playernum)
|
||||
{
|
||||
// Don't leave a NiGHTS ghost!
|
||||
if ((players[playernum].pflags & PF_NIGHTSMODE) && players[playernum].mo->tracer)
|
||||
{
|
||||
P_RemoveMobj(players[playernum].mo->tracer);
|
||||
P_SetTarget(&players[playernum].mo->tracer, NULL);
|
||||
}
|
||||
|
||||
P_RemoveMobj(players[playernum].mo);
|
||||
P_SetTarget(&players[playernum].mo, NULL);
|
||||
}
|
||||
|
||||
// Wipe the struct.
|
||||
memset(&players[playernum], 0, sizeof (player_t));
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -4250,9 +4250,6 @@ void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
|
||||
mobj_t *cachenext;
|
||||
|
||||
killnext:
|
||||
if (P_MobjWasRemoved(banana))
|
||||
return;
|
||||
|
||||
cachenext = banana->hnext;
|
||||
|
||||
if (banana->health)
|
||||
@@ -4540,8 +4537,10 @@ void K_RepairOrbitChain(mobj_t *orbit)
|
||||
}
|
||||
|
||||
// Then recount to make sure item amount is correct
|
||||
if (orbit->target && orbit->target->player && !P_MobjWasRemoved(orbit->target))
|
||||
if (orbit->target && orbit->target->player)
|
||||
{
|
||||
player_t *player = orbit->target->player;
|
||||
|
||||
INT32 num = 0;
|
||||
|
||||
mobj_t *cur = orbit->target->hnext;
|
||||
@@ -4551,14 +4550,14 @@ void K_RepairOrbitChain(mobj_t *orbit)
|
||||
{
|
||||
prev = cur;
|
||||
cur = cur->hnext;
|
||||
if (++num > orbit->target->player->kartstuff[k_itemamount])
|
||||
if (++num > player->kartstuff[k_itemamount])
|
||||
P_RemoveMobj(prev);
|
||||
else
|
||||
prev->movedir = num;
|
||||
}
|
||||
|
||||
if (orbit->target && !P_MobjWasRemoved(orbit->target) && orbit->target->player->kartstuff[k_itemamount] != num)
|
||||
orbit->target->player->kartstuff[k_itemamount] = num;
|
||||
if (player->kartstuff[k_itemamount] != num)
|
||||
player->kartstuff[k_itemamount] = num;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1621,7 +1621,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
|
||||
// SRB2kart
|
||||
// I wish I knew a better way to do this
|
||||
if (!P_MobjWasRemoved(target->target) && target->target->player && !P_MobjWasRemoved(target->target->player->mo))
|
||||
if (target->target && target->target->player && target->target->player->mo)
|
||||
{
|
||||
if (target->target->player->kartstuff[k_eggmanheld] && target->type == MT_EGGMANITEM_SHIELD)
|
||||
target->target->player->kartstuff[k_eggmanheld] = 0;
|
||||
@@ -1634,7 +1634,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount])
|
||||
{
|
||||
if (target->target->hnext && !P_MobjWasRemoved(target->target->hnext))
|
||||
if (target->target->hnext)
|
||||
K_KillBananaChain(target->target->hnext, inflictor, source);
|
||||
target->target->player->kartstuff[k_itemamount] = 0;
|
||||
}
|
||||
|
||||
+11
-18
@@ -4667,15 +4667,16 @@ static void P_Boss7Thinker(mobj_t *mobj)
|
||||
if (P_AproxDistance(players[i].mo->x - mobj->x, players[i].mo->y - mobj->y) > (mobj->radius + players[i].mo->radius))
|
||||
continue;
|
||||
|
||||
if (!(players[i].mo->z > mobj->z + mobj->height - FRACUNIT && players[i].mo->z < mobj->z + mobj->height + 128*FRACUNIT)) // You can't be in the vicinity, either...
|
||||
continue;
|
||||
if (players[i].mo->z > mobj->z + mobj->height - FRACUNIT
|
||||
&& players[i].mo->z < mobj->z + mobj->height + 128*FRACUNIT) // You can't be in the vicinity, either...
|
||||
{
|
||||
// Punch him!
|
||||
P_DamageMobj(players[i].mo, mobj, mobj, 1);
|
||||
mobj->state->nextstate = mobj->info->spawnstate;
|
||||
|
||||
// Punch him!
|
||||
P_DamageMobj(players[i].mo, mobj, mobj, 1);
|
||||
mobj->state->nextstate = mobj->info->spawnstate;
|
||||
|
||||
// Laugh
|
||||
S_StartSound(0, sfx_bewar1 + P_RandomKey(4));
|
||||
// Laugh
|
||||
S_StartSound(0, sfx_bewar1 + P_RandomKey(4));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mobj->state == &states[S_BLACKEGG_GOOP])
|
||||
@@ -10059,21 +10060,13 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||
|
||||
if (mobj->hnext && !P_MobjWasRemoved(mobj->hnext))
|
||||
{
|
||||
if (mobj->hnext->hprev == mobj)
|
||||
{
|
||||
P_SetTarget(&mobj->hnext->hprev, mobj->hprev);
|
||||
}
|
||||
|
||||
P_SetTarget(&mobj->hnext->hprev, mobj->hprev);
|
||||
P_SetTarget(&mobj->hnext, NULL);
|
||||
}
|
||||
|
||||
if (mobj->hprev && !P_MobjWasRemoved(mobj->hprev))
|
||||
{
|
||||
if (mobj->hprev->hnext == mobj)
|
||||
{
|
||||
P_SetTarget(&mobj->hprev->hnext, cachenext);
|
||||
}
|
||||
|
||||
P_SetTarget(&mobj->hprev->hnext, cachenext);
|
||||
P_SetTarget(&mobj->hprev, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -2718,8 +2718,6 @@ static void P_NetUnArchiveThinkers(void)
|
||||
{
|
||||
next = currentthinker->next;
|
||||
|
||||
currentthinker->references = 0; // Heinous but this is the only place the assertion in P_UnlinkThinkers is wrong
|
||||
|
||||
if (currentthinker->function.acp1 == (actionf_p1)P_MobjThinker || currentthinker->function.acp1 == (actionf_p1)P_NullPrecipThinker)
|
||||
P_RemoveSavegameMobj((mobj_t *)currentthinker); // item isn't saved, don't remove it
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user