- fixed A_Chase default detection.

This commit is contained in:
Christoph Oelckers 2019-01-03 23:43:15 +01:00
parent 6d87716381
commit f9ff097457
4 changed files with 11 additions and 4 deletions

View file

@ -1070,3 +1070,4 @@ xx(SpotOuterAngle)
xx(lightflags)
xx(lighttype)
xx(InternalDynamicLight)
xx(_a_chase_default)

View file

@ -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;

View file

@ -509,6 +509,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;
@ -534,6 +535,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)

View file

@ -1021,7 +1021,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();