diff --git a/src/namedef.h b/src/namedef.h index a0d395f888..d6832613da 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -1034,3 +1034,10 @@ xx(RedCard) xx(BlueSkull) xx(YellowSkull) xx(RedSkull) +xx(DynamicLight) +xx(SpotInnerAngle) +xx(SpotOuterAngle) +xx(lightflags) +xx(lighttype) +xx(InternalDynamicLight) +xx(_a_chase_default) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 823d803d58..54a383073c 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2769,12 +2769,16 @@ void A_Chase(AActor *self) DEFINE_ACTION_FUNCTION(AActor, A_Chase) { PARAM_SELF_PROLOGUE(AActor); - PARAM_STATE(melee); - PARAM_STATE(missile); + PARAM_STATELABEL(meleelabel); + PARAM_STATELABEL(missilelabel); PARAM_INT(flags); - if (melee != nullptr || missile != nullptr || flags != 0x40000000) + FName meleename = ENamedName(meleelabel - 0x10000000); + FName missilename = ENamedName(missilelabel - 0x10000000); + if (meleename != NAME__a_chase_default || missilename != NAME__a_chase_default) { + FState *melee = StateLabels.GetState(meleelabel, self->GetClass()); + FState *missile = StateLabels.GetState(missilelabel, self->GetClass()); if ((flags & CHF_RESURRECT) && P_CheckForResurrection(self, false)) return 0; diff --git a/src/scripting/vm/vm.h b/src/scripting/vm/vm.h index 6e3a1f08b9..00e991c7e9 100644 --- a/src/scripting/vm/vm.h +++ b/src/scripting/vm/vm.h @@ -513,6 +513,7 @@ bool AssertObject(void * ob); #define PARAM_ANGLE_AT(p,x) assert((p) < numparam); assert(reginfo[p] == REGT_FLOAT); DAngle x = param[p].f; #define PARAM_STRING_VAL_AT(p,x) assert((p) < numparam); assert(reginfo[p] == REGT_STRING); FString x = param[p].s(); #define PARAM_STRING_AT(p,x) assert((p) < numparam); assert(reginfo[p] == REGT_STRING); const FString &x = param[p].s(); +#define PARAM_STATELABEL_AT(p,x) assert((p) < numparam); assert(reginfo[p] == REGT_INT); int x = param[p].i; #define PARAM_STATE_AT(p,x) assert((p) < numparam); assert(reginfo[p] == REGT_INT); FState *x = (FState *)StateLabels.GetState(param[p].i, self->GetClass()); #define PARAM_STATE_ACTION_AT(p,x) assert((p) < numparam); assert(reginfo[p] == REGT_INT); FState *x = (FState *)StateLabels.GetState(param[p].i, stateowner->GetClass()); #define PARAM_POINTER_AT(p,x,type) assert((p) < numparam); assert(reginfo[p] == REGT_POINTER); type *x = (type *)param[p].a; @@ -538,6 +539,7 @@ bool AssertObject(void * ob); #define PARAM_ANGLE(x) ++paramnum; PARAM_ANGLE_AT(paramnum,x) #define PARAM_STRING(x) ++paramnum; PARAM_STRING_AT(paramnum,x) #define PARAM_STRING_VAL(x) ++paramnum; PARAM_STRING_VAL_AT(paramnum,x) +#define PARAM_STATELABEL(x) ++paramnum; PARAM_STATELABEL_AT(paramnum,x) #define PARAM_STATE(x) ++paramnum; PARAM_STATE_AT(paramnum,x) #define PARAM_STATE_ACTION(x) ++paramnum; PARAM_STATE_ACTION_AT(paramnum,x) #define PARAM_POINTER(x,type) ++paramnum; PARAM_POINTER_AT(paramnum,x,type) diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 9fc91d7c37..77e7d5b49e 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -1018,7 +1018,7 @@ class Actor : Thinker native native void A_NoBlocking(bool drop = true); void A_Fall() { A_NoBlocking(); } native void A_Look(); - native void A_Chase(statelabel melee = null, statelabel missile = null, int flags = 0x40000000); + native void A_Chase(statelabel melee = '_a_chase_default', statelabel missile = '_a_chase_default', int flags = 0); native void A_VileChase(); native bool A_CheckForResurrection(); native void A_BossDeath();