From 59ad6206de43e1b1a17f2a384a27dbd15f72006b Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Wed, 2 Mar 2016 20:35:54 -0600 Subject: [PATCH] Added CBF_NOACTORS to A_CheckBlock. - Self explanatory, doesn't count actors as blocking them. --- src/thingdef/thingdef_codeptr.cpp | 9 ++++++--- wadsrc/static/actors/constants.txt | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index ad5dfb32ea..5f518fab0d 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -6683,12 +6683,13 @@ The SET pointer flags only affect the caller, not the pointer. ===========================================================================*/ 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_SETMASTER = 1 << 2, //^ but with master. 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_DROPOFF = 1 << 5, //Check for dropoffs. + CBF_NOACTORS = 1 << 6, //Don't check actors. }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock) @@ -6731,8 +6732,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock) { ACTION_RETURN_STATE(NULL); } - //[MC] Easiest way to tell if an actor is blocking it, use the pointers. - if (mobj->BlockingMobj || (!(flags & CBF_NOLINES) && mobj->BlockingLine != NULL)) + //[MC] I don't know why I let myself be persuaded not to include a flag. + //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); } diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index e5733e0338..3060c2c2d9 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -526,6 +526,7 @@ enum 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_DROPOFF = 1 << 5, //Check for dropoffs. + CBF_NOACTORS = 1 << 6, //Don't check actors. }; enum