revert pretty much all mobj changes for now
might reapply them some other time, but since we need to maintain vanilla compat as much as possible gonna revert crap kinda sick of desynching stuffs and honestly most the mobj stuff rarely ever crashes
This commit is contained in:
1 parent
7ef4eedd06
commit
17f8996afc
4 files changed
+15
-16
No files matched your search
+6
-7
@@ -4171,9 +4171,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)
|
||||
@@ -4461,8 +4458,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;
|
||||
@@ -4472,14 +4471,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
@@ -1646,7 +1646,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;
|
||||
@@ -1659,7 +1659,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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -10095,6 +10095,8 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||
if (mobj->spawnpoint)
|
||||
mobj->spawnpoint->mobj = NULL;
|
||||
|
||||
R_RemoveMobjInterpolator(mobj);
|
||||
|
||||
// free block
|
||||
// DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error.
|
||||
if (mobj->flags & MF_NOTHINK && !mobj->thinker.next)
|
||||
@@ -10126,8 +10128,6 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||
#endif
|
||||
P_RemoveThinker((thinker_t *)mobj);
|
||||
}
|
||||
|
||||
R_RemoveMobjInterpolator(mobj);
|
||||
}
|
||||
|
||||
// This does not need to be added to Lua.
|
||||
|
||||
+5
-5
@@ -227,15 +227,15 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
|
||||
if (thinker->references)
|
||||
return;
|
||||
|
||||
R_DestroyLevelInterpolators(thinker);
|
||||
|
||||
/* Remove from main thinker list */
|
||||
thinker_t *next = thinker->next;
|
||||
/* Note that currentthinker is guaranteed to point to us,
|
||||
* and since we're freeing our memory, we had better change that. So
|
||||
* point it to thinker->prev, so the iterator will correctly move on to
|
||||
* thinker->prev->next = thinker->next */
|
||||
currentthinker = thinker->prev;
|
||||
/* Remove from main thinker list */
|
||||
P_UnlinkThinker(thinker);
|
||||
(next->prev = currentthinker = thinker->prev)->next = next;
|
||||
R_DestroyLevelInterpolators(thinker);
|
||||
Z_Free(thinker);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user