mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
Fix mbf21 add / remove NOBLOCKMAP or NOSECTOR (#1930)
Co-authored-by: Xaser Acheron <xaser.88@gmail.com>
This commit is contained in:
parent
ec0e91f1e2
commit
1d27148032
@ -3270,6 +3270,7 @@ void A_JumpIfFlagsSet(mobj_t* actor)
|
||||
void A_AddFlags(mobj_t* actor)
|
||||
{
|
||||
unsigned int flags, flags2;
|
||||
boolean update_blockmap;
|
||||
|
||||
if (!mbf21 || !actor)
|
||||
return;
|
||||
@ -3277,8 +3278,19 @@ void A_AddFlags(mobj_t* actor)
|
||||
flags = actor->state->args[0];
|
||||
flags2 = actor->state->args[1];
|
||||
|
||||
// unlink/relink the thing from the blockmap if
|
||||
// the NOBLOCKMAP or NOSECTOR flags are added
|
||||
update_blockmap = ((flags & MF_NOBLOCKMAP) && !(actor->flags & MF_NOBLOCKMAP))
|
||||
|| ((flags & MF_NOSECTOR) && !(actor->flags & MF_NOSECTOR));
|
||||
|
||||
if (update_blockmap)
|
||||
P_UnsetThingPosition(actor);
|
||||
|
||||
actor->flags |= flags;
|
||||
actor->flags2 |= flags2;
|
||||
|
||||
if (update_blockmap)
|
||||
P_SetThingPosition(actor);
|
||||
}
|
||||
|
||||
//
|
||||
@ -3290,6 +3302,7 @@ void A_AddFlags(mobj_t* actor)
|
||||
void A_RemoveFlags(mobj_t* actor)
|
||||
{
|
||||
unsigned int flags, flags2;
|
||||
boolean update_blockmap;
|
||||
|
||||
if (!mbf21 || !actor)
|
||||
return;
|
||||
@ -3297,8 +3310,19 @@ void A_RemoveFlags(mobj_t* actor)
|
||||
flags = actor->state->args[0];
|
||||
flags2 = actor->state->args[1];
|
||||
|
||||
// unlink/relink the thing from the blockmap if
|
||||
// the NOBLOCKMAP or NOSECTOR flags are removed
|
||||
update_blockmap = ((flags & MF_NOBLOCKMAP) && (actor->flags & MF_NOBLOCKMAP))
|
||||
|| ((flags & MF_NOSECTOR) && (actor->flags & MF_NOSECTOR));
|
||||
|
||||
if (update_blockmap)
|
||||
P_UnsetThingPosition(actor);
|
||||
|
||||
actor->flags &= ~flags;
|
||||
actor->flags2 &= ~flags2;
|
||||
|
||||
if (update_blockmap)
|
||||
P_SetThingPosition(actor);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user