mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Merge branch 'idk-what-to-call-this-branch' into 'next'
A_SetObjectFlags tweak Only reset the sector/blockmap links on an object calling A_SetObjectFlags if the MF_NOSECTOR|MF_NOBLOCKMAP flags change. Fixes a freeze related to LD442 demonstrated in MascaraSnake's example WAD at https://dl.dropboxusercontent.com/u/27962790/statetest.wad . See merge request !11
This commit is contained in:
commit
b2e330d64c
1 changed files with 19 additions and 12 deletions
|
@ -7650,25 +7650,32 @@ 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
|
||||||
|
|
||||||
|
if (locvar2 == 2)
|
||||||
|
locvar1 = actor->flags | locvar1;
|
||||||
|
else if (locvar2 == 1)
|
||||||
|
locvar1 = actor->flags & ~locvar1;
|
||||||
|
|
||||||
|
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);
|
P_UnsetThingPosition(actor);
|
||||||
if (sector_list)
|
if (sector_list)
|
||||||
{
|
{
|
||||||
P_DelSeclist(sector_list);
|
P_DelSeclist(sector_list);
|
||||||
sector_list = NULL;
|
sector_list = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (locvar2 == 2)
|
|
||||||
actor->flags |= locvar1;
|
|
||||||
else if (locvar2 == 1)
|
|
||||||
actor->flags &= ~locvar1;
|
|
||||||
else
|
|
||||||
actor->flags = locvar1;
|
actor->flags = locvar1;
|
||||||
|
|
||||||
|
if (unlinkthings)
|
||||||
P_SetThingPosition(actor);
|
P_SetThingPosition(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue