mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-29 05:41:02 +00:00
Make A_SetObjectFlags only reset sector/bmap links if needed
This commit is contained in:
parent
f7c463418e
commit
ddd66b9eff
1 changed files with 19 additions and 12 deletions
|
@ -7650,26 +7650,33 @@ void A_SetObjectFlags(mobj_t *actor)
|
||||||
{
|
{
|
||||||
INT32 locvar1 = var1;
|
INT32 locvar1 = var1;
|
||||||
INT32 locvar2 = var2;
|
INT32 locvar2 = var2;
|
||||||
|
boolean unlinkthings = false;
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_SetObjectFlags", actor))
|
if (LUA_CallAction("A_SetObjectFlags", actor))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
P_UnsetThingPosition(actor);
|
if (locvar2 == 2)
|
||||||
if (sector_list)
|
locvar1 = actor->flags | locvar1;
|
||||||
{
|
else if (locvar2 == 1)
|
||||||
P_DelSeclist(sector_list);
|
locvar1 = actor->flags & ~locvar1;
|
||||||
sector_list = NULL;
|
|
||||||
|
if ((locvar1 & (MF_NOBLOCKMAP|MF_NOSECTOR)) != (actor->flags & (MF_NOBLOCKMAP|MF_NOSECTOR))) // Blockmap/sector status has changed, so reset the links
|
||||||
|
unlinkthings = true;
|
||||||
|
|
||||||
|
if (unlinkthings) {
|
||||||
|
P_UnsetThingPosition(actor);
|
||||||
|
if (sector_list)
|
||||||
|
{
|
||||||
|
P_DelSeclist(sector_list);
|
||||||
|
sector_list = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locvar2 == 2)
|
actor->flags = locvar1;
|
||||||
actor->flags |= locvar1;
|
|
||||||
else if (locvar2 == 1)
|
|
||||||
actor->flags &= ~locvar1;
|
|
||||||
else
|
|
||||||
actor->flags = locvar1;
|
|
||||||
|
|
||||||
P_SetThingPosition(actor);
|
if (unlinkthings)
|
||||||
|
P_SetThingPosition(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function: A_SetObjectFlags2
|
// Function: A_SetObjectFlags2
|
||||||
|
|
Loading…
Reference in a new issue