From 39df62b20e3d46c6f3d145e9b1be2b157daa67d0 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 19 Apr 2016 20:21:00 -0500 Subject: [PATCH] Remove "action" from Actor functions that don't actually need it - An actor function really only needs to be an action function if: 1. It can be called with no parameters specified, either because it takes none or because all its parameters are optional. This lets SetState() call it directly without creating a wrapper function for it. 2. It wants access to the callingstate or stateowner parameters. Most functions don't care about them, so passing them is superfluous. --- src/g_hexen/a_fighterquietus.cpp | 2 +- src/g_strife/a_thingstoblowup.cpp | 2 +- src/info.h | 4 + src/p_enemy.cpp | 2 +- src/thingdef/thingdef_codeptr.cpp | 271 +++++++++++++-------------- src/thingdef/thingdef_exp.h | 1 + src/thingdef/thingdef_expression.cpp | 2 +- wadsrc/static/actors/actor.txt | 216 ++++++++++----------- 8 files changed, 245 insertions(+), 255 deletions(-) diff --git a/src/g_hexen/a_fighterquietus.cpp b/src/g_hexen/a_fighterquietus.cpp index 27e787d31..3d04e984a 100644 --- a/src/g_hexen/a_fighterquietus.cpp +++ b/src/g_hexen/a_fighterquietus.cpp @@ -26,7 +26,7 @@ static FRandom pr_fswordflame ("FSwordFlame"); DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS(p1, AActor); PARAM_CLASS(p2, AActor); PARAM_CLASS(p3, AActor); diff --git a/src/g_strife/a_thingstoblowup.cpp b/src/g_strife/a_thingstoblowup.cpp index 3644bb54c..fed1c4337 100644 --- a/src/g_strife/a_thingstoblowup.cpp +++ b/src/g_strife/a_thingstoblowup.cpp @@ -28,7 +28,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Bang4Cloud) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveQuestItem) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(questitem); // Give one of these quest items to every player in the game diff --git a/src/info.h b/src/info.h index 285894dc7..6d3de5015 100644 --- a/src/info.h +++ b/src/info.h @@ -345,4 +345,8 @@ void AddStateLight(FState *state, const char *lname); // Number of action paramaters #define NAP 3 +#define PARAM_SELF_PROLOGUE(type) \ + PARAM_PROLOGUE; \ + PARAM_OBJECT(self, type); + #endif // __INFO_H__ diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index b12a84432..6c3e375ac 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2773,7 +2773,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VileChase) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ExtChase) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_BOOL (domelee); PARAM_BOOL (domissile); PARAM_BOOL_OPT (playactive) { playactive = true; } diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 309392191..7e89c8b70 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -207,8 +207,7 @@ DEFINE_ACTION_FUNCTION(AActor, CheckClass) if (numret > 0) { assert(ret != NULL); - PARAM_PROLOGUE; - PARAM_OBJECT (self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS (checktype, AActor); PARAM_INT_OPT (pick_pointer) { pick_pointer = AAPTR_DEFAULT; } PARAM_BOOL_OPT (match_superclass) { match_superclass = false; } @@ -244,8 +243,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, IsPointerEqual) if (numret > 0) { assert(ret != NULL); - PARAM_PROLOGUE; - PARAM_OBJECT (self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (ptr_select1); PARAM_INT (ptr_select2); @@ -268,8 +266,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, CountInv) if (numret > 0) { assert(ret != NULL); - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS(itemtype, AInventory); PARAM_INT_OPT(pick_pointer) { pick_pointer = AAPTR_DEFAULT; } @@ -300,8 +297,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetDistance) if (numret > 0) { assert(ret != NULL); - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_BOOL(checkz); PARAM_INT_OPT(ptr) { ptr = AAPTR_TARGET; } @@ -333,8 +329,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetSpawnHealth) { if (numret > 0) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); ret->SetInt(self->SpawnHealth()); return 1; } @@ -350,8 +345,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetGibHealth) { if (numret > 0) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); ret->SetInt(self->GetGibHealth()); return 1; } @@ -372,32 +366,28 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetGibHealth) DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_state__) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(returnme); ACTION_RETURN_STATE(returnme); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_int__) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(returnme); ACTION_RETURN_INT(returnme); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_bool__) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_BOOL(returnme); ACTION_RETURN_BOOL(returnme); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_float__) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, AActor); + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(returnme); if (numret > 0) { @@ -420,7 +410,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, __decorate_internal_float__) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RearrangePointers) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (ptr_target); PARAM_INT_OPT (ptr_master) { ptr_master = AAPTR_DEFAULT; } PARAM_INT_OPT (ptr_tracer) { ptr_tracer = AAPTR_TRACER; } @@ -500,7 +490,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RearrangePointers) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TransferPointer) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (ptr_source); PARAM_INT (ptr_recipient); PARAM_INT (ptr_sourcefield); @@ -659,7 +649,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ComboAttack) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BasicAttack) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (melee_damage); PARAM_SOUND (melee_sound); PARAM_CLASS (missile_type, AActor); @@ -721,7 +711,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StopSound) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayWeaponSound) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_SOUND(soundid); S_Sound(self, CHAN_WEAPON, soundid, 1, ATTN_NORM); @@ -730,7 +720,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayWeaponSound) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySoundEx) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_SOUND (soundid); PARAM_NAME (channel); PARAM_BOOL_OPT (looping) { looping = false; } @@ -767,7 +757,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlaySoundEx) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StopSoundEx) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME(channel); if (channel > NAME_Auto && channel <= NAME_SoundSlot7) @@ -791,7 +781,7 @@ enum }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SeekerMissile) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(ang1); PARAM_INT(ang2); PARAM_INT_OPT(flags) { flags = 0; } @@ -848,7 +838,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BulletAttack) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Jump) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT_OPT(maxchance) { maxchance = 256; } paramnum++; // Increment paramnum to point at the first jump target @@ -869,7 +859,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Jump) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHealthLower) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (health); PARAM_STATE (jump); PARAM_INT_OPT (ptr_selector) { ptr_selector = AAPTR_DEFAULT; } @@ -892,7 +882,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHealthLower) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetOutsideMeleeRange) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); if (!self->CheckMeleeRange()) @@ -909,7 +899,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetOutsideMeleeRange) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInsideMeleeRange) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); if (self->CheckMeleeRange()) @@ -926,7 +916,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInsideMeleeRange) //========================================================================== static int DoJumpIfCloser(AActor *target, VM_ARGS) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT (dist); PARAM_STATE (jump); PARAM_BOOL_OPT(noz) { noz = false; } @@ -947,7 +937,7 @@ static int DoJumpIfCloser(AActor *target, VM_ARGS) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfCloser) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); AActor *target; @@ -967,13 +957,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfCloser) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTracerCloser) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); return DoJumpIfCloser(self->tracer, VM_ARGS_NAMES); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfMasterCloser) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); return DoJumpIfCloser(self->master, VM_ARGS_NAMES); } @@ -982,9 +972,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfMasterCloser) // State jump function // //========================================================================== -int DoJumpIfInventory(AActor *owner, AActor *self, AActor *stateowner, FState *callingstate, VMValue *param, int numparam, VMReturn *ret, int numret) +int DoJumpIfInventory(AActor *owner, AActor *self, VMValue *param, int numparam, VMReturn *ret, int numret) { - int paramnum = NAP-1; + int paramnum = 0; PARAM_CLASS (itemtype, AInventory); PARAM_INT (itemamount); PARAM_STATE (label); @@ -1021,14 +1011,14 @@ int DoJumpIfInventory(AActor *owner, AActor *self, AActor *stateowner, FState *c DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInventory) { - PARAM_ACTION_PROLOGUE; - return DoJumpIfInventory(self, self, stateowner, callingstate, param, numparam, ret, numret); + PARAM_SELF_PROLOGUE(AActor); + return DoJumpIfInventory(self, self, param, numparam, ret, numret); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetInventory) { - PARAM_ACTION_PROLOGUE; - return DoJumpIfInventory(self->target, self, stateowner, callingstate, param, numparam, ret, numret); + PARAM_SELF_PROLOGUE(AActor); + return DoJumpIfInventory(self->target, self, param, numparam, ret, numret); } //========================================================================== @@ -1038,7 +1028,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetInventory) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfArmorType) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (type); PARAM_STATE (label); PARAM_INT_OPT(amount) { amount = 1; } @@ -1161,7 +1151,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CallSpecial) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (special); PARAM_INT_OPT (arg1) { arg1 = 0; } PARAM_INT_OPT (arg2) { arg2 = 0; } @@ -1194,7 +1184,7 @@ enum CM_Flags DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS (ti, AActor); PARAM_FLOAT_OPT (Spawnheight) { Spawnheight = 32; } PARAM_FLOAT_OPT (Spawnofs_xy) { Spawnofs_xy = 0; } @@ -1338,7 +1328,7 @@ enum CBA_Flags DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_ANGLE (spread_xy); PARAM_ANGLE (spread_z); PARAM_INT (numbullets); @@ -1440,7 +1430,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMeleeAttack) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomComboAttack) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS (ti, AActor); PARAM_FLOAT (spawnheight); PARAM_INT (damage); @@ -1874,7 +1864,7 @@ enum DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (damage); PARAM_INT_OPT (spawnofs_xy) { spawnofs_xy = 0; } PARAM_COLOR_OPT (color1) { color1 = 0; } @@ -1990,7 +1980,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) static bool DoGiveInventory(AActor *receiver, bool orresult, VM_ARGS) { - int paramnum = NAP-1; + int paramnum = 0; PARAM_CLASS (mi, AInventory); PARAM_INT_OPT (amount) { amount = 1; } @@ -2040,19 +2030,19 @@ static bool DoGiveInventory(AActor *receiver, bool orresult, VM_ARGS) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveInventory) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); ACTION_RETURN_BOOL(DoGiveInventory(self, false, VM_ARGS_NAMES)); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToTarget) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); ACTION_RETURN_BOOL(DoGiveInventory(self->target, false, VM_ARGS_NAMES)); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToChildren) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); TThinkerIterator it; AActor *mo; @@ -2070,7 +2060,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToChildren) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToSiblings) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); TThinkerIterator it; AActor *mo; @@ -2102,7 +2092,7 @@ enum bool DoTakeInventory(AActor *receiver, bool orresult, VM_ARGS) { - int paramnum = NAP-1; + int paramnum = 0; PARAM_CLASS (itemtype, AInventory); PARAM_INT_OPT (amount) { amount = 0; } PARAM_INT_OPT (flags) { flags = 0; } @@ -2126,19 +2116,19 @@ bool DoTakeInventory(AActor *receiver, bool orresult, VM_ARGS) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeInventory) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); ACTION_RETURN_BOOL(DoTakeInventory(self, false, VM_ARGS_NAMES)); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromTarget) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); ACTION_RETURN_BOOL(DoTakeInventory(self->target, false, VM_ARGS_NAMES)); } DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromChildren) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); TThinkerIterator it; AActor *mo; int count = 0; @@ -2155,7 +2145,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromChildren) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromSiblings) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); TThinkerIterator it; AActor *mo; int count = 0; @@ -2445,7 +2435,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItem) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS (missile, AActor); PARAM_FLOAT_OPT (xofs) { xofs = 0; } PARAM_FLOAT_OPT (yofs) { yofs = 0; } @@ -2607,7 +2597,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(xyvel); self->Thrust(self->Angles.Yaw + 180., xyvel); @@ -2622,7 +2612,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SelectWeapon) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS(cls, AWeapon); if (cls == NULL || self->player == NULL) @@ -2656,7 +2646,7 @@ EXTERN_CVAR(Float, con_midtime) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Print) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STRING (text); PARAM_FLOAT_OPT (time) { time = 0; } PARAM_NAME_OPT (fontname) { fontname = NAME_None; } @@ -2691,7 +2681,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Print) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PrintBold) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STRING (text); PARAM_FLOAT_OPT (time) { time = 0; } PARAM_NAME_OPT (fontname) { fontname = NAME_None; } @@ -2722,7 +2712,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PrintBold) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STRING(text); if (text[0] == '$') text = GStrings(&text[1]); @@ -2739,7 +2729,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LogInt) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(num); Printf("%d\n", num); return 0; @@ -2753,7 +2743,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LogInt) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LogFloat) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(num); IGNORE_FORMAT_PRE Printf("%H\n", num); @@ -2768,7 +2758,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LogFloat) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTranslucent) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT (alpha); PARAM_INT_OPT (mode) { mode = 0; } @@ -2864,7 +2854,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeOut) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeTo) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT (target); PARAM_FLOAT_OPT (amount) { amount = 0.1; } PARAM_INT_OPT (flags) { flags = 0; } @@ -2909,7 +2899,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeTo) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetScale) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT (scalex); PARAM_FLOAT_OPT (scaley) { scaley = scalex; } PARAM_INT_OPT (ptr) { ptr = AAPTR_DEFAULT; } @@ -2937,7 +2927,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetScale) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetMass) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (mass); self->Mass = mass; @@ -2951,7 +2941,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetMass) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnDebris) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS (debris, AActor); PARAM_BOOL_OPT (transfer_translation) { transfer_translation = false; } PARAM_FLOAT_OPT (mult_h) { mult_h = 1; } @@ -3006,7 +2996,7 @@ enum SPFflag DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_COLOR (color); PARAM_INT_OPT (flags) { flags = 0; } PARAM_INT_OPT (lifetime) { lifetime = 35; } @@ -3067,7 +3057,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSight) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); for (int i = 0; i < MAXPLAYERS; i++) @@ -3136,7 +3126,7 @@ static bool DoCheckSightOrRange(AActor *self, AActor *camera, double range, bool DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSightOrRange) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(range); PARAM_STATE(jump); PARAM_BOOL_OPT(twodi) { twodi = false; } @@ -3165,7 +3155,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSightOrRange) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckRange) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(range); PARAM_STATE(jump); PARAM_BOOL_OPT(twodi) { twodi = false; } @@ -3199,7 +3189,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckRange) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropInventory) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS(drop, AInventory); if (drop) @@ -3221,7 +3211,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropInventory) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetBlend) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_COLOR (color); PARAM_FLOAT (alpha); PARAM_INT (tics); @@ -3248,7 +3238,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetBlend) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIf) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_BOOL (condition); PARAM_STATE (jump); @@ -3263,7 +3253,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIf) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CountdownArg) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(cnt); PARAM_STATE_OPT(state) { state = self->FindState(NAME_Death); } @@ -3294,7 +3284,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CountdownArg) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS(chunk, AActor); int i, numChunks; @@ -3352,7 +3342,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFloor) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); if (self->Z() <= self->floorz) @@ -3371,7 +3361,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFloor) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckCeiling) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); if (self->Top() >= self->ceilingz) // Height needs to be counted @@ -3389,7 +3379,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckCeiling) //=========================================================================== DEFINE_ACTION_FUNCTION(AActor, A_Stop) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); self->Vel.Zero(); if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING)) { @@ -3506,7 +3496,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayerSkinCheck) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); if (self->player != NULL && @@ -3524,7 +3514,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PlayerSkinCheck) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetGravity) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(gravity); self->Gravity = clamp(gravity, 0., 10.); @@ -3689,7 +3679,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckLOF) DVector3 pos; DVector3 vel; - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE (jump); PARAM_INT_OPT (flags) { flags = 0; } PARAM_FLOAT_OPT (range) { range = 0; } @@ -3881,7 +3871,7 @@ enum JLOS_flags DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInLOS) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE (jump); PARAM_ANGLE_OPT (fov) { fov = 0.; } PARAM_INT_OPT (flags) { flags = 0; } @@ -4017,7 +4007,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInLOS) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetLOS) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE (jump); PARAM_ANGLE_OPT (fov) { fov = 0.; } PARAM_INT_OPT (flags) { flags = 0; } @@ -4168,7 +4158,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ResetReloadCounter) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeFlag) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STRING (flagname); PARAM_BOOL (value); @@ -4267,7 +4257,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeFlag) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFlag) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STRING (flagname); PARAM_STATE (jumpto); PARAM_INT_OPT (checkpointer) { checkpointer = AAPTR_DEFAULT; } @@ -4359,7 +4349,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS (AActor, A_FaceConsolePlayer) { - // NOTE: It does nothing for zdoom. + // NOTE: It does nothing for ZDoom, since in a multiplayer game, each + // node has its own console player. return 0; } @@ -4372,7 +4363,7 @@ DEFINE_ACTION_FUNCTION_PARAMS (AActor, A_FaceConsolePlayer) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MonsterRefire) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (prob); PARAM_STATE (jump); @@ -4431,19 +4422,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(pitch); PARAM_INT_OPT(flags) { flags = 0; } PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } AActor *ref = COPY_AAPTR(self, ptr); - if (ref == NULL) + if (ref != NULL) { - return 0; + ref->SetPitch(pitch, !!(flags & SPF_INTERPOLATE), !!(flags & SPF_FORCECLAMP)); } - - ref->SetPitch(pitch, !!(flags & SPF_INTERPOLATE), !!(flags & SPF_FORCECLAMP)); return 0; } @@ -4457,7 +4446,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRoll) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT (roll); PARAM_INT_OPT (flags) { flags = 0; } PARAM_INT_OPT (ptr) { ptr = AAPTR_DEFAULT; } @@ -4480,7 +4469,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRoll) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ScaleVelocity) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(scale); PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } @@ -4561,7 +4550,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeVelocity) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetArg) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(pos); PARAM_INT(value); @@ -4581,7 +4570,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetArg) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpecial) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (spec); PARAM_INT_OPT (arg0) { arg0 = 0; } PARAM_INT_OPT (arg1) { arg1 = 0; } @@ -4619,8 +4608,7 @@ static PField *GetVar(DObject *self, FName varname) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVar) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, DObject); + PARAM_SELF_PROLOGUE(DObject); PARAM_NAME (varname); PARAM_INT (value); @@ -4635,8 +4623,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVar) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserVarFloat) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, DObject); + PARAM_SELF_PROLOGUE(DObject); PARAM_NAME (varname); PARAM_FLOAT (value); @@ -4678,8 +4665,7 @@ static PField *GetArrayVar(DObject *self, FName varname, int pos) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserArray) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, DObject); + PARAM_SELF_PROLOGUE(DObject); PARAM_NAME (varname); PARAM_INT (pos); PARAM_INT (value); @@ -4696,8 +4682,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserArray) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetUserArrayFloat) { - PARAM_PROLOGUE; - PARAM_OBJECT(self, DObject); + PARAM_SELF_PROLOGUE(DObject); PARAM_NAME (varname); PARAM_INT (pos); PARAM_FLOAT (value); @@ -4931,7 +4916,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Turn) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Quake) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (intensity); PARAM_INT (duration); PARAM_INT (damrad); @@ -4952,7 +4937,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Quake) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_QuakeEx) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(intensityX); PARAM_INT(intensityY); PARAM_INT(intensityZ); @@ -5020,7 +5005,7 @@ void A_Weave(AActor *self, int xyspeed, int zspeed, double xydist, double zdist) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Weave) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (xspeed); PARAM_INT (yspeed); PARAM_FLOAT (xdist); @@ -5256,7 +5241,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp) DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedExecuteWithResult) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (scriptname); PARAM_INT_OPT (arg1) { arg1 = 0; } PARAM_INT_OPT (arg2) { arg2 = 0; } @@ -5269,7 +5254,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedExecuteWithResult) DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedExecute) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (scriptname); PARAM_INT_OPT (mapnum) { mapnum = 0; } PARAM_INT_OPT (arg1) { arg1 = 0; } @@ -5282,7 +5267,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedExecute) DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedExecuteAlways) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (scriptname); PARAM_INT_OPT (mapnum) { mapnum = 0; } PARAM_INT_OPT (arg1) { arg1 = 0; } @@ -5295,7 +5280,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedExecuteAlways) DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedLockedExecute) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (scriptname); PARAM_INT_OPT (mapnum) { mapnum = 0; } PARAM_INT_OPT (arg1) { arg1 = 0; } @@ -5308,7 +5293,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedLockedExecute) DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedLockedExecuteDoor) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (scriptname); PARAM_INT_OPT (mapnum) { mapnum = 0; } PARAM_INT_OPT (arg1) { arg1 = 0; } @@ -5321,7 +5306,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedLockedExecuteDoor) DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedSuspend) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (scriptname); PARAM_INT_OPT (mapnum) { mapnum = 0; } @@ -5331,7 +5316,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedSuspend) DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedTerminate) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME (scriptname); PARAM_INT_OPT (mapnum) { mapnum = 0; } @@ -5517,7 +5502,7 @@ static bool DoRadiusGive(AActor *self, AActor *thing, PClassActor *item, int amo DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS (item, AInventory); PARAM_FLOAT (distance); PARAM_INT (flags); @@ -5568,7 +5553,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSpecies) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); PARAM_NAME_OPT(species) { species = NAME_None; } PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } @@ -5617,7 +5602,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTics) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetDamageType) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME(damagetype); self->DamageType = damagetype; @@ -5632,7 +5617,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetDamageType) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropItem) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS (spawntype, AActor); PARAM_INT_OPT (amount) { amount = -1; } PARAM_INT_OPT (chance) { chance = 256; } @@ -5648,7 +5633,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropItem) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpeed) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(speed); PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } @@ -5668,7 +5653,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpeed) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetFloatSpeed) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(speed); PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } @@ -5690,7 +5675,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetFloatSpeed) //========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPainThreshold) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(threshold); PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } @@ -5773,7 +5758,7 @@ static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageTy //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageSelf) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (amount); PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; } PARAM_INT_OPT (flags) { flags = 0; } @@ -5791,7 +5776,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageSelf) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageTarget) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (amount); PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; } PARAM_INT_OPT (flags) { flags = 0; } @@ -5810,7 +5795,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageTarget) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageTracer) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (amount); PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; } PARAM_INT_OPT (flags) { flags = 0; } @@ -5829,7 +5814,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageTracer) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageMaster) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (amount); PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; } PARAM_INT_OPT (flags) { flags = 0; } @@ -5848,7 +5833,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageMaster) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageChildren) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (amount); PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; } PARAM_INT_OPT (flags) { flags = 0; } @@ -5873,7 +5858,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageChildren) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageSiblings) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (amount); PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; } PARAM_INT_OPT (flags) { flags = 0; } @@ -6214,7 +6199,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveSiblings) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Remove) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (removee); PARAM_INT_OPT (flags) { flags = 0; } PARAM_CLASS_OPT (filter, AActor){ filter = NULL; } @@ -6238,7 +6223,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Remove) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTeleFog) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS(oldpos, AActor); PARAM_CLASS(newpos, AActor); @@ -6275,7 +6260,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SwapTeleFog) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetFloatBobPhase) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(bob); //Respect float bob phase limits. @@ -6295,7 +6280,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetFloatBobPhase) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetHealth) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT (health); PARAM_INT_OPT (ptr) { ptr = AAPTR_DEFAULT; } @@ -6368,7 +6353,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ResetHealth) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHigherOrLower) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(high); PARAM_STATE(low); PARAM_FLOAT_OPT(offsethigh) { offsethigh = 0; } @@ -6400,7 +6385,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHigherOrLower) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpecies) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_NAME(species); PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } @@ -6422,7 +6407,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpecies) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipperLevel) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(level); self->RipperLevel = level; return 0; @@ -6436,7 +6421,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipperLevel) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMin) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(min); self->RipLevelMin = min; return 0; @@ -6450,7 +6435,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMin) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMax) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(max); self->RipLevelMax = max; return 0; @@ -6466,7 +6451,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMax) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetChaseThreshold) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_INT(threshold); PARAM_BOOL_OPT(def) { def = false; } PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } @@ -6509,7 +6494,7 @@ enum CPXFflags }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckProximity) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(jump); PARAM_CLASS(classname, AActor); PARAM_FLOAT(distance); @@ -6667,7 +6652,7 @@ enum CBF DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock) { - PARAM_ACTION_PROLOGUE; + PARAM_SELF_PROLOGUE(AActor); PARAM_STATE(block) PARAM_INT_OPT(flags) { flags = 0; } PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; } diff --git a/src/thingdef/thingdef_exp.h b/src/thingdef/thingdef_exp.h index 9a0f2dc78..9ec605626 100644 --- a/src/thingdef/thingdef_exp.h +++ b/src/thingdef/thingdef_exp.h @@ -881,6 +881,7 @@ public: ExpEmit Emit(VMFunctionBuilder *build, bool tailcall); bool CheckEmitCast(VMFunctionBuilder *build, bool returnit, ExpEmit ®); unsigned GetArgCount() const { return ArgList == NULL ? 0 : ArgList->Size(); } + PFunction *GetFunction() const { return Function; } VMFunction *GetVMFunction() const { return Function->Variants[0].Implementation; } bool IsDirectFunction(); }; diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 3c0eaa584..8ca02b422 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -3844,7 +3844,7 @@ VMFunction *FxReturnStatement::GetDirectFunction() // then it can be a "direct" function. That is, the DECORATE // definition can call that function directly without wrapping // it inside VM code. - if (Call != NULL && Call->GetArgCount() == 0) + if (Call != NULL && Call->GetArgCount() == 0 && (Call->GetFunction()->Flags & VARF_Action)) { return Call->GetVMFunction(); } diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index d02c7d1d7..1355fd7a8 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -110,7 +110,7 @@ ACTOR Actor native //: Thinker action native A_Die(name damagetype = "none"); action native A_Detonate(); action native A_Mushroom(class spawntype = "FatShot", int numspawns = 0, int flags = 0, float vrange = 4.0, float hrange = 0.5); - action native bool A_CallSpecial(int special, int arg1=0, int arg2=0, int arg3=0, int arg4=0, int arg5=0); + native bool A_CallSpecial(int special, int arg1=0, int arg2=0, int arg3=0, int arg4=0, int arg5=0); action native A_SetFloorClip(); action native A_UnSetFloorClip(); @@ -127,7 +127,7 @@ ACTOR Actor native //: Thinker action native A_NoGravity(); action native A_Gravity(); action native A_LowGravity(); - action native A_SetGravity(float gravity); + native void A_SetGravity(float gravity); action native A_Fall(); action native A_SetSolid(); action native A_UnsetSolid(); @@ -168,7 +168,7 @@ ACTOR Actor native //: Thinker action native A_ClearSoundTarget(); action native A_FireAssaultGun(); action native A_CheckTerrain(); - action native A_FaceConsolePlayer(float MaxTurnAngle = 0); // [TP] + action native A_FaceConsolePlayer(float MaxTurnAngle = 0); // [TP] no-op action native A_MissileAttack(); action native A_MeleeAttack(); @@ -176,75 +176,75 @@ ACTOR Actor native //: Thinker action native A_BulletAttack(); action native A_WolfAttack(int flags = 0, sound whattoplay = "weapons/pistol", float snipe = 1.0, int maxdamage = 64, int blocksize = 128, int pointblank = 2, int longrange = 4, float runspeed = 160.0, class pufftype = "BulletPuff"); action native A_PlaySound(sound whattoplay = "weapons/pistol", int slot = CHAN_BODY, float volume = 1.0, bool looping = false, float attenuation = ATTN_NORM); - action native A_PlayWeaponSound(sound whattoplay); + native void A_PlayWeaponSound(sound whattoplay); action native A_FLoopActiveSound(); action native A_LoopActiveSound(); action native A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was... - action native A_PlaySoundEx(sound whattoplay, coerce name slot, bool looping = false, int attenuation = 0); - action native A_StopSoundEx(coerce name slot); - action native A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10); - action native state A_Jump(int chance = 256, state label, ...); - action native A_CustomMissile(class missiletype, float spawnheight = 32, float spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 0, int ptr = AAPTR_TARGET); - action native A_CustomBulletAttack(float/*angle*/ spread_xy, float/*angle*/ spread_z, int numbullets, int damageperbullet, class pufftype = "BulletPuff", float range = 0, int flags = 0, int ptr = AAPTR_TARGET); - action native A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, int aim = 0, float maxdiff = 0, class pufftype = "BulletPuff", float/*angle*/ spread_xy = 0, float/*angle*/ spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270); - action native state A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT); - action native state A_JumpIfCloser(float distance, state label, bool noz = false); - action native state A_JumpIfTracerCloser(float distance, state label, bool noz = false); - action native state A_JumpIfMasterCloser(float distance, state label, bool noz = false); - action native state A_JumpIfTargetOutsideMeleeRange(state label); - action native state A_JumpIfTargetInsideMeleeRange(state label); - action native state A_JumpIfInventory(class itemtype, int itemamount, state label, int owner = AAPTR_DEFAULT); - action native state A_JumpIfArmorType(name Type, state label, int amount = 1); - action native bool A_GiveInventory(class itemtype, int amount = 0, int giveto = AAPTR_DEFAULT); - action native bool A_TakeInventory(class itemtype, int amount = 0, int flags = 0, int giveto = AAPTR_DEFAULT); + native void A_PlaySoundEx(sound whattoplay, coerce name slot, bool looping = false, int attenuation = 0); + native void A_StopSoundEx(coerce name slot); + native void A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10); + native state A_Jump(int chance = 256, state label, ...); + native void A_CustomMissile(class missiletype, float spawnheight = 32, float spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 0, int ptr = AAPTR_TARGET); + native void A_CustomBulletAttack(float/*angle*/ spread_xy, float/*angle*/ spread_z, int numbullets, int damageperbullet, class pufftype = "BulletPuff", float range = 0, int flags = 0, int ptr = AAPTR_TARGET); + native void A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, int aim = 0, float maxdiff = 0, class pufftype = "BulletPuff", float/*angle*/ spread_xy = 0, float/*angle*/ spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270); + native state A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT); + native state A_JumpIfCloser(float distance, state label, bool noz = false); + native state A_JumpIfTracerCloser(float distance, state label, bool noz = false); + native state A_JumpIfMasterCloser(float distance, state label, bool noz = false); + native state A_JumpIfTargetOutsideMeleeRange(state label); + native state A_JumpIfTargetInsideMeleeRange(state label); + native state A_JumpIfInventory(class itemtype, int itemamount, state label, int owner = AAPTR_DEFAULT); + native state A_JumpIfArmorType(name Type, state label, int amount = 1); + native bool A_GiveInventory(class itemtype, int amount = 0, int giveto = AAPTR_DEFAULT); + native bool A_TakeInventory(class itemtype, int amount = 0, int flags = 0, int giveto = AAPTR_DEFAULT); action native bool A_SpawnItem(class itemtype = "Unknown", float distance = 0, float zheight = 0, bool useammo = true, bool transfer_translation = false); - action native bool A_SpawnItemEx(class itemtype, float xofs = 0, float yofs = 0, float zofs = 0, float xvel = 0, float yvel = 0, float zvel = 0, float angle = 0, int flags = 0, int failchance = 0, int tid=0); - action native A_Print(string whattoprint, float time = 0, name fontname = ""); - action native A_PrintBold(string whattoprint, float time = 0, name fontname = ""); - action native A_Log(string whattoprint); - action native A_LogInt(int whattoprint); - action native A_LogFloat(float whattoprint); - action native A_SetTranslucent(float alpha, int style = 0); + native bool A_SpawnItemEx(class itemtype, float xofs = 0, float yofs = 0, float zofs = 0, float xvel = 0, float yvel = 0, float zvel = 0, float angle = 0, int flags = 0, int failchance = 0, int tid=0); + native void A_Print(string whattoprint, float time = 0, name fontname = ""); + native void A_PrintBold(string whattoprint, float time = 0, name fontname = ""); + native void A_Log(string whattoprint); + native void A_LogInt(int whattoprint); + native void A_LogFloat(float whattoprint); + native void A_SetTranslucent(float alpha, int style = 0); action native A_FadeIn(float reduce = 0.1, int flags = 0); action native A_FadeOut(float reduce = 0.1, int flags = 1); //bool remove == true - action native A_FadeTo(float target, float amount = 0.1, int flags = 0); - action native A_SetScale(float scalex, float scaley = 0, int ptr = AAPTR_DEFAULT, bool usezero = false); - action native A_SetMass(int mass); - action native A_SpawnDebris(class spawntype, bool transfer_translation = false, float mult_h = 1, float mult_v = 1); - action native A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, int size = 1, float angle = 0, float xoff = 0, float yoff = 0, float zoff = 0, float velx = 0, float vely = 0, float velz = 0, float accelx = 0, float accely = 0, float accelz = 0, float startalphaf = 1, float fadestepf = -1); - action native state A_CheckSight(state label); - action native A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false); - action native A_DropInventory(class itemtype); - action native A_SetBlend(color color1, float alpha, int tics, color color2 = ""); - action native A_ChangeFlag(string flagname, bool value); - action native state A_CheckFlag(string flagname, state label, int check_pointer = AAPTR_DEFAULT); - action native state A_JumpIf(bool expression, state label); + native void A_FadeTo(float target, float amount = 0.1, int flags = 0); + native void A_SetScale(float scalex, float scaley = 0, int ptr = AAPTR_DEFAULT, bool usezero = false); + native void A_SetMass(int mass); + native void A_SpawnDebris(class spawntype, bool transfer_translation = false, float mult_h = 1, float mult_v = 1); + native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, int size = 1, float angle = 0, float xoff = 0, float yoff = 0, float zoff = 0, float velx = 0, float vely = 0, float velz = 0, float accelx = 0, float accely = 0, float accelz = 0, float startalphaf = 1, float fadestepf = -1); + native state A_CheckSight(state label); + native void A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false); + native void A_DropInventory(class itemtype); + native void A_SetBlend(color color1, float alpha, int tics, color color2 = ""); + native void A_ChangeFlag(string flagname, bool value); + native state A_CheckFlag(string flagname, state label, int check_pointer = AAPTR_DEFAULT); + native state A_JumpIf(bool expression, state label); action native A_RaiseMaster(bool copy = 0); action native A_RaiseChildren(bool copy = 0); action native A_RaiseSiblings(bool copy = 0); - action native state A_CheckFloor(state label); - action native state A_CheckCeiling(state label); - action native state A_PlayerSkinCheck(state label); - action native A_BasicAttack(int meleedamage, sound meleesound, class missiletype, float missileheight); + native state A_CheckFloor(state label); + native state A_CheckCeiling(state label); + native state A_PlayerSkinCheck(state label); + native void A_BasicAttack(int meleedamage, sound meleesound, class missiletype, float missileheight); action native state, bool A_Teleport(state teleportstate = "", class targettype = "BossSpot", class fogtype = "TeleportFog", int flags = 0, float mindist = 0, float maxdist = 0, int ptr = AAPTR_DEFAULT); action native state, bool A_Warp(int ptr_destination, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0, int flags = 0, state success_state = "", float heightoffset = 0, float radiusoffset = 0, float pitch = 0); action native bool A_ThrowGrenade(class itemtype, float zheight = 0, float xyvel = 0, float zvel = 0, bool useammo = true); - action native A_Weave(int xspeed, int yspeed, float xdist, float ydist); + native void A_Weave(int xspeed, int yspeed, float xdist, float ydist); - action native A_Recoil(float xyvel); - action native state A_JumpIfInTargetInventory(class itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT); - action native bool A_GiveToTarget(class itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT); - action native bool A_TakeFromTarget(class itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT); - action native int A_RadiusGive(class itemtype, float distance, int flags, int amount = 0, class filter = "None", name species = "None", int mindist = 0); - action native state A_CheckSpecies(state jump, name species = "", int ptr = AAPTR_DEFAULT); - action native A_CountdownArg(int argnum, state targstate = ""); + native void A_Recoil(float xyvel); + native state A_JumpIfInTargetInventory(class itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT); + native bool A_GiveToTarget(class itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT); + native bool A_TakeFromTarget(class itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT); + native int A_RadiusGive(class itemtype, float distance, int flags, int amount = 0, class filter = "None", name species = "None", int mindist = 0); + native state A_CheckSpecies(state jump, name species = "", int ptr = AAPTR_DEFAULT); + native void A_CountdownArg(int argnum, state targstate = ""); action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true); - action native A_CustomComboAttack(class missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true); - action native A_Burst(class chunktype); + native void A_CustomComboAttack(class missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true); + native void A_Burst(class chunktype); action native A_Blast(int flags = 0, float strength = 255, float radius = 255, float speed = 20, class blasteffect = "BlastEffect", sound blastsound = "BlastRadius"); action native A_RadiusThrust(int force = 128, int distance = -1, int flags = RTF_AFFECTSOURCE, int fullthrustdistance = 0); action native A_Explode(int damage = -1, int distance = -1, int flags = XF_HURTSOURCE, bool alert = false, int fulldamagedistance = 0, int nails = 0, int naildamage = 10, class pufftype = "BulletPuff"); - action native A_Stop(); + native void A_Stop(); action native A_Respawn(int flags = 1); action native A_BarrelDestroy(); action native A_QueueCorpse(); @@ -252,10 +252,10 @@ ACTOR Actor native //: Thinker action native A_LookEx(int flags = 0, float minseedist = 0, float maxseedist = 0, float maxheardist = 0, float fov = 0, state label = ""); action native A_ClearLastHeard(); action native A_ClearTarget(); - action native state A_CheckLOF(state jump, int flags = 0, float range = 0, float minrange = 0, float angle = 0, float pitch = 0, float offsetheight = 0, float offsetwidth = 0, int ptr_target = AAPTR_DEFAULT, float offsetforward = 0); - action native state A_JumpIfTargetInLOS (state label, float/*angle*/ fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0); - action native state A_JumpIfInTargetLOS (state label, float/*angle*/ fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0); - action native bool A_SelectWeapon(class whichweapon); + native state A_CheckLOF(state jump, int flags = 0, float range = 0, float minrange = 0, float angle = 0, float pitch = 0, float offsetheight = 0, float offsetwidth = 0, int ptr_target = AAPTR_DEFAULT, float offsetforward = 0); + native state A_JumpIfTargetInLOS (state label, float/*angle*/ fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0); + native state A_JumpIfInTargetLOS (state label, float/*angle*/ fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0); + native bool A_SelectWeapon(class whichweapon); action native A_Punch(); action native A_Feathers(); action native A_ClassBossHealth(); @@ -263,36 +263,36 @@ ACTOR Actor native //: Thinker action native A_RocketInFlight(); action native A_Bang4Cloud(); action native A_DropFire(); - action native A_GiveQuestItem(int itemno); + native void A_GiveQuestItem(int itemno); action native A_RemoveForcefield(); - action native A_DropWeaponPieces(class p1, class p2, class p3); + native void A_DropWeaponPieces(class p1, class p2, class p3); action native A_PigPain (); - action native state A_MonsterRefire(int chance, state label); - action native A_SetAngle(float angle = 0, int flags = 0, int ptr = AAPTR_DEFAULT); - action native A_SetPitch(float pitch, int flags = 0, int ptr = AAPTR_DEFAULT); - action native A_SetRoll(float/*angle*/ roll, int flags = 0, int ptr = AAPTR_DEFAULT); - action native A_ScaleVelocity(float scale, int ptr = AAPTR_DEFAULT); + native state A_MonsterRefire(int chance, state label); + native void A_SetAngle(float angle = 0, int flags = 0, int ptr = AAPTR_DEFAULT); + native void A_SetPitch(float pitch, int flags = 0, int ptr = AAPTR_DEFAULT); + native void A_SetRoll(float/*angle*/ roll, int flags = 0, int ptr = AAPTR_DEFAULT); + native void A_ScaleVelocity(float scale, int ptr = AAPTR_DEFAULT); action native A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0, int ptr = AAPTR_DEFAULT); - action native A_SetArg(int pos, int value); + native void A_SetArg(int pos, int value); native void A_SetUserVar(name varname, int value); native void A_SetUserArray(name varname, int index, int value); native void A_SetUserVarFloat(name varname, float value); native void A_SetUserArrayFloat(name varname, int index, float value); - action native A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0); - action native A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake"); - action native A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, sound sfx = "world/quake", int flags = 0, float mulWaveX = 1, float mulWaveY = 1, float mulWaveZ = 1, int falloff = 0, int highpoint = 0); + native void A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0); + native void A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake"); + native void A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, sound sfx = "world/quake", int flags = 0, float mulWaveX = 1, float mulWaveY = 1, float mulWaveZ = 1, int falloff = 0, int highpoint = 0); action native A_SetTics(int tics); - action native A_SetDamageType(name damagetype); - action native A_DropItem(class item, int dropamount = -1, int chance = 256); - action native A_SetSpeed(float speed, int ptr = AAPTR_DEFAULT); - action native A_SetFloatSpeed(float speed, int ptr = AAPTR_DEFAULT); - action native A_SetPainThreshold(int threshold, int ptr = AAPTR_DEFAULT); - action native A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); - action native A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); - action native A_DamageMaster(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); - action native A_DamageTracer(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); - action native A_DamageChildren(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); - action native A_DamageSiblings(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); + native void A_SetDamageType(name damagetype); + native void A_DropItem(class item, int dropamount = -1, int chance = 256); + native void A_SetSpeed(float speed, int ptr = AAPTR_DEFAULT); + native void A_SetFloatSpeed(float speed, int ptr = AAPTR_DEFAULT); + native void A_SetPainThreshold(int threshold, int ptr = AAPTR_DEFAULT); + native void A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); + native void A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); + native void A_DamageMaster(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); + native void A_DamageTracer(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); + native void A_DamageChildren(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); + native void A_DamageSiblings(int amount, name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); action native A_KillTarget(name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); action native A_KillMaster(name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); action native A_KillTracer(name damagetype = "none", int flags = 0, class filter = "None", name species = "None"); @@ -303,39 +303,39 @@ ACTOR Actor native //: Thinker action native A_RemoveTracer(int flags = 0, class filter = "None", name species = "None"); action native A_RemoveChildren(bool removeall = false, int flags = 0, class filter = "None", name species = "None"); action native A_RemoveSiblings(bool removeall = false, int flags = 0, class filter = "None", name species = "None"); - action native A_Remove(int removee, int flags = 0, class filter = "None", name species = "None"); - action native int A_GiveToChildren(class itemtype, int amount = 0); - action native int A_GiveToSiblings(class itemtype, int amount = 0); - action native int A_TakeFromChildren(class itemtype, int amount = 0); - action native int A_TakeFromSiblings(class itemtype, int amount = 0); - action native A_SetTeleFog(class oldpos, class newpos); + native void A_Remove(int removee, int flags = 0, class filter = "None", name species = "None"); + native int A_GiveToChildren(class itemtype, int amount = 0); + native int A_GiveToSiblings(class itemtype, int amount = 0); + native int A_TakeFromChildren(class itemtype, int amount = 0); + native int A_TakeFromSiblings(class itemtype, int amount = 0); + native void A_SetTeleFog(class oldpos, class newpos); action native A_SwapTeleFog(); - action native A_SetFloatBobPhase(int bob); - action native A_SetHealth(int health, int ptr = AAPTR_DEFAULT); + native void A_SetFloatBobPhase(int bob); + native void A_SetHealth(int health, int ptr = AAPTR_DEFAULT); action native A_ResetHealth(int ptr = AAPTR_DEFAULT); - action native state A_JumpIfHigherOrLower(state high, state low, float offsethigh = 0, float offsetlow = 0, bool includeHeight = true, int ptr = AAPTR_TARGET); - action native A_SetSpecies(name species, int ptr = AAPTR_DEFAULT); - action native A_SetRipperLevel(int level); - action native A_SetRipMin(int mininum); - action native A_SetRipMax(int maximum); - action native A_SetChaseThreshold(int threshold, bool def = false, int ptr = AAPTR_DEFAULT); - action native state A_CheckProximity(state jump, class classname, float distance, int count = 1, int flags = 0, int ptr = AAPTR_DEFAULT); - action native state A_CheckBlock(state block, int flags = 0, int ptr = AAPTR_DEFAULT, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0); - action native state A_CheckSightOrRange(float distance, state label, bool two_dimension = false); - action native state A_CheckRange(float distance, state label, bool two_dimension = false); + native state A_JumpIfHigherOrLower(state high, state low, float offsethigh = 0, float offsetlow = 0, bool includeHeight = true, int ptr = AAPTR_TARGET); + native void A_SetSpecies(name species, int ptr = AAPTR_DEFAULT); + native void A_SetRipperLevel(int level); + native void A_SetRipMin(int mininum); + native void A_SetRipMax(int maximum); + native void A_SetChaseThreshold(int threshold, bool def = false, int ptr = AAPTR_DEFAULT); + native state A_CheckProximity(state jump, class classname, float distance, int count = 1, int flags = 0, int ptr = AAPTR_DEFAULT); + native state A_CheckBlock(state block, int flags = 0, int ptr = AAPTR_DEFAULT, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0); + native state A_CheckSightOrRange(float distance, state label, bool two_dimension = false); + native state A_CheckRange(float distance, state label, bool two_dimension = false); action native bool A_FaceMovementDirection(float offset = 0, float anglelimit = 0, float pitchlimit = 0, int flags = 0, int ptr = AAPTR_DEFAULT); - action native A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, int newtracer = AAPTR_DEFAULT, int flags=0); - action native A_TransferPointer(int ptr_source, int ptr_recepient, int sourcefield, int recepientfield=AAPTR_DEFAULT, int flags=0); + native void A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, int newtracer = AAPTR_DEFAULT, int flags=0); + native void A_TransferPointer(int ptr_source, int ptr_recepient, int sourcefield, int recepientfield=AAPTR_DEFAULT, int flags=0); action native A_CopyFriendliness(int ptr_source = AAPTR_MASTER); - action native int ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); - action native int ACS_NamedSuspend(name script, int mapnum=0); - action native int ACS_NamedTerminate(name script, int mapnum=0); - action native int ACS_NamedLockedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); - action native int ACS_NamedLockedExecuteDoor(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); - action native int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0); - action native ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); + native int ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); + native int ACS_NamedSuspend(name script, int mapnum=0); + native int ACS_NamedTerminate(name script, int mapnum=0); + native int ACS_NamedLockedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); + native int ACS_NamedLockedExecuteDoor(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); + native int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0); + native void ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); States {