Added CBF_NOACTORS to A_CheckBlock.

- Self explanatory, doesn't count actors as blocking them.
This commit is contained in:
MajorCooke 2016-03-02 20:35:54 -06:00
parent 7f672039bf
commit 59ad6206de
2 changed files with 7 additions and 3 deletions

View file

@ -6683,12 +6683,13 @@ The SET pointer flags only affect the caller, not the pointer.
===========================================================================*/ ===========================================================================*/
enum CBF enum CBF
{ {
CBF_NOLINES = 1 << 0, //Don't check actors. CBF_NOLINES = 1 << 0, //Don't check lines.
CBF_SETTARGET = 1 << 1, //Sets the caller/pointer's target to the actor blocking it. Actors only. CBF_SETTARGET = 1 << 1, //Sets the caller/pointer's target to the actor blocking it. Actors only.
CBF_SETMASTER = 1 << 2, //^ but with master. CBF_SETMASTER = 1 << 2, //^ but with master.
CBF_SETTRACER = 1 << 3, //^ but with tracer. CBF_SETTRACER = 1 << 3, //^ but with tracer.
CBF_SETONPTR = 1 << 4, //Sets the pointer change on the actor doing the checking instead of self. CBF_SETONPTR = 1 << 4, //Sets the pointer change on the actor doing the checking instead of self.
CBF_DROPOFF = 1 << 5, //Check for dropoffs. CBF_DROPOFF = 1 << 5, //Check for dropoffs.
CBF_NOACTORS = 1 << 6, //Don't check actors.
}; };
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock)
@ -6731,8 +6732,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock)
{ {
ACTION_RETURN_STATE(NULL); ACTION_RETURN_STATE(NULL);
} }
//[MC] Easiest way to tell if an actor is blocking it, use the pointers. //[MC] I don't know why I let myself be persuaded not to include a flag.
if (mobj->BlockingMobj || (!(flags & CBF_NOLINES) && mobj->BlockingLine != NULL)) //If an actor is loaded with pointers, they don't really have any options to spare.
if ((!(flags & CBF_NOACTORS) && (mobj->BlockingMobj)) || (!(flags & CBF_NOLINES) && mobj->BlockingLine != NULL))
{ {
ACTION_RETURN_STATE(block); ACTION_RETURN_STATE(block);
} }

View file

@ -526,6 +526,7 @@ enum
CBF_SETTRACER = 1 << 3, //^ but with tracer. CBF_SETTRACER = 1 << 3, //^ but with tracer.
CBF_SETONPTR = 1 << 4, //Sets the pointer change on the actor doing the checking instead of self. CBF_SETONPTR = 1 << 4, //Sets the pointer change on the actor doing the checking instead of self.
CBF_DROPOFF = 1 << 5, //Check for dropoffs. CBF_DROPOFF = 1 << 5, //Check for dropoffs.
CBF_NOACTORS = 1 << 6, //Don't check actors.
}; };
enum enum