Revert "more reference fixes"

This reverts commit 94bd1cb37b.
This commit is contained in:
Alug committed 2024-08-03 17:36:31 +02:00
1 parent 8b60fb6b6c
commit 96ee117657
3 files changed
+14 -35

No files matched your search

+1 -3
View File
@@ -53,12 +53,10 @@ static UINT8 lib_searchBlockmap_Objects(lua_State *L, INT32 x, INT32 y, mobj_t *
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1);
blockfuncerror = true;
P_SetTarget(&bnext, NULL);
return 0; // *shrugs*
}
if (!lua_isnil(gL, -1))
{ // if nil, continue
P_SetTarget(&bnext, NULL);
if (lua_toboolean(gL, -1))
return 2; // stop whole search
else
@@ -258,4 +256,4 @@ int LUA_BlockmapLib(lua_State *L)
{
lua_register(L, "searchBlockmap", lib_searchBlockmap);
return 0;
}
}
+8 -10
View File
@@ -1548,13 +1548,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
tmfloorz = tmceilingz = topz; // block while in air
tmceilingslope = NULL;
P_SetTarget(&tmfloorthing, thing); // needed for side collision
tmfloorthing = thing; // needed for side collision
}
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
{
tmceilingz = topz;
tmceilingslope = NULL;
P_SetTarget(&tmfloorthing, thing); // thing we may stand on
tmfloorthing = thing; // thing we may stand on
}
}
else
@@ -1585,13 +1585,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
tmfloorz = tmceilingz = topz; // block while in air
tmfloorslope = NULL;
P_SetTarget(&tmfloorthing, thing); // needed for side collision
tmfloorthing = thing; // needed for side collision
}
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
{
tmfloorz = topz;
tmfloorslope = NULL;
P_SetTarget(&tmfloorthing, thing); // thing we may stand on
tmfloorthing = thing; // thing we may stand on
}
}
}
@@ -1991,8 +1991,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
}
// tmfloorthing is set when tmfloorz comes from a thing's top
P_SetTarget(&tmfloorthing, NULL);
P_SetTarget(&tmhitthing, NULL);
tmfloorthing = NULL;
tmhitthing = NULL;
validcount++;
@@ -2489,10 +2489,8 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
if (tmceilingz - tmfloorz < thing->height)
{
if (tmfloorthing != NULL)
{
P_SetTarget(&tmhitthing, tmfloorthing);
}
if (tmfloorthing)
tmhitthing = tmfloorthing;
return false; // doesn't fit
}
+5 -22
View File
@@ -6112,8 +6112,7 @@ void P_MobjThinker(mobj_t *mobj)
mobj->flags2 &= ~MF2_PUSHED;
mobj->eflags &= ~(MFE_SPRUNG|MFE_JUSTBOUNCEDWALL);
P_SetTarget(&tmfloorthing, NULL);
P_SetTarget(&tmhitthing, NULL);
tmfloorthing = tmhitthing = NULL;
// 970 allows ANY mobj to trigger a linedef exec
if (mobj->subsector && GETSECSPECIAL(mobj->subsector->sector->special, 2) == 8)
@@ -10070,29 +10069,13 @@ void P_RemoveMobj(mobj_t *mobj)
P_SetTarget(&mobj->target, NULL);
P_SetTarget(&mobj->tracer, NULL);
// repair hnext chain
mobj_t *cachenext = mobj->hnext;
if (mobj->hnext && !P_MobjWasRemoved(mobj->hnext))
{
if (mobj->hnext->hprev == mobj)
{
P_SetTarget(&mobj->hnext->hprev, mobj->hprev);
}
P_SetTarget(&mobj->hnext, NULL);
}
P_SetTarget(&mobj->hnext->hprev, mobj->hprev);
if (mobj->hprev && !P_MobjWasRemoved(mobj->hprev))
{
if (mobj->hprev->hnext == mobj)
{
P_SetTarget(&mobj->hprev->hnext, cachenext);
}
P_SetTarget(&mobj->hprev->hnext, mobj->hnext);
P_SetTarget(&mobj->hnext, P_SetTarget(&mobj->hprev, NULL));
P_SetTarget(&mobj->hprev, NULL);
}
// clear the reference from the mapthing
if (mobj->spawnpoint)
P_SetTarget(&mobj->spawnpoint->mobj, NULL);