- fixed: All functions that are callable from weapon states and not members of Actor need to be declared 'action'.

With the stricter type checks of the self pointer that were now implemented these all produced errors.
This commit is contained in:
Christoph Oelckers 2016-11-13 14:20:30 +01:00
parent 7d49a82963
commit a2f4cd7cda
38 changed files with 185 additions and 237 deletions

View File

@ -336,29 +336,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_OpenShotgun2)
{
PARAM_SELF_PROLOGUE(AActor);
S_Sound (self, CHAN_WEAPON, "weapons/sshoto", 1, ATTN_NORM);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_LoadShotgun2)
{
PARAM_SELF_PROLOGUE(AActor);
S_Sound (self, CHAN_WEAPON, "weapons/sshotl", 1, ATTN_NORM);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CloseShotgun2)
{
PARAM_SELF_PROLOGUE(AActor);
S_Sound (self, CHAN_WEAPON, "weapons/sshotc", 1, ATTN_NORM);
A_ReFire (self);
return 0;
}
//------------------------------------------------------------------------------------
//
// Setting a random flash like some of Doom's weapons can easily crash when the
@ -593,12 +570,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireRailgunLeft)
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_RailWait)
{
// Okay, this was stupid. Just use a NULL function instead of this.
return 0;
}
//
// A_FireBFG
//
@ -717,16 +688,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
return 0;
}
//
// A_BFGsound
//
DEFINE_ACTION_FUNCTION(AActor, A_BFGsound)
{
PARAM_SELF_PROLOGUE(AActor);
S_Sound (self, CHAN_WEAPON, "weapons/bfgf", 1, ATTN_NORM);
return 0;
}
//
// A_FireOldBFG
//

View File

@ -138,7 +138,7 @@ void P_UpdateBeak (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_BeakRaise)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -170,7 +170,7 @@ void P_PlayPeck (AActor *chicken)
DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -205,7 +205,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;

View File

@ -61,7 +61,7 @@ extern bool P_AutoUseChaosDevice (player_t *player);
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
DAngle slope;
@ -107,7 +107,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -144,7 +144,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
int i;
DAngle angle;
@ -187,7 +187,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -216,7 +216,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -247,7 +247,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL2)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle Angle;
int damage;
@ -421,7 +421,7 @@ void FireMacePL1B (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *ball;
player_t *player;
@ -579,7 +579,7 @@ boom:
DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;
@ -761,7 +761,7 @@ int ARipper::DoSpecialDamage (AActor *target, int damage, FName damagetype)
DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -888,7 +888,7 @@ void ARainTracker::Serialize(FSerializer &arc)
DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;
@ -924,7 +924,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
AActor *MissileActor;
@ -1217,7 +1217,7 @@ int APhoenixFX2::DoSpecialDamage (AActor *target, int damage, FName damagetype)
DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -1270,7 +1270,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
DEFINE_ACTION_FUNCTION(AActor, A_InitPhoenixPL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -1293,7 +1293,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_InitPhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
@ -1346,7 +1346,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_ShutdownPhoenixPL2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;

View File

@ -66,7 +66,7 @@ void ACFlameMissile::Effect ()
DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;

View File

@ -211,7 +211,7 @@ void SpawnSpiritTail (AActor *spirit)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
FTranslatedLineTarget t;
@ -245,7 +245,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyPalette)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{

View File

@ -15,7 +15,7 @@ static FRandom pr_maceatk ("CMaceAttack");
DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;

View File

@ -46,7 +46,7 @@ int ACStaffMissile::DoSpecialDamage (AActor *target, int damage, FName damagetyp
DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
APlayerPawn *pmo;
int damage;
@ -115,7 +115,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;
@ -167,7 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffMissileSlither)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffInitBlink)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
self->weaponspecial = (pr_blink()>>1)+20;
return 0;
@ -181,7 +181,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffInitBlink)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheckBlink)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player && self->player->ReadyWeapon)
{

View File

@ -19,13 +19,6 @@ DECLARE_ACTION(A_Raise)
static FRandom pr_axeatk ("FAxeAtk");
void A_FAxeCheckReady (AActor *actor);
void A_FAxeCheckUp (AActor *actor);
void A_FAxeCheckAtk (AActor *actor);
void A_FAxeCheckReadyG (AActor *actor);
void A_FAxeCheckUpG (AActor *actor);
void A_FAxeAttack (AActor *actor);
// The Fighter's Axe --------------------------------------------------------
class AFWeapAxe : public AFighterWeapon
@ -68,7 +61,7 @@ FState *AFWeapAxe::GetAtkState (bool hold)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReady)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -95,7 +88,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReady)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReadyG)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -122,7 +115,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReadyG)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUp)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -149,7 +142,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUp)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUpG)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -176,7 +169,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUpG)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckAtk)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -199,7 +192,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckAtk)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int power;

View File

@ -25,7 +25,7 @@ static FRandom pr_hammeratk ("FHammerAtk");
DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -95,7 +95,7 @@ hammerdone:
DEFINE_ACTION_FUNCTION(AActor, A_FHammerThrow)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;

View File

@ -99,7 +99,7 @@ static bool TryPunch(APlayerPawn *pmo, DAngle angle, int damage, int power)
DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
int damage;
int i;

View File

@ -78,7 +78,7 @@ int AFSwordMissile::DoSpecialDamage(AActor *victim, int damage, FName damagetype
DEFINE_ACTION_FUNCTION(AActor, A_FSwordAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;

View File

@ -51,7 +51,7 @@ int AFrostMissile::DoSpecialDamage (AActor *victim, int damage, FName damagetype
DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;

View File

@ -126,7 +126,7 @@ int ALightningZap::SpecialMissileHit (AActor *thing)
DEFINE_ACTION_FUNCTION(AActor, A_LightningReady)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DoReadyWeapon(self);
if (pr_lightningready() < 160)
@ -257,7 +257,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MLightningAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
PARAM_CLASS_DEF(floor, AActor);
PARAM_CLASS_DEF(ceiling, AActor);

View File

@ -122,7 +122,7 @@ void MStaffSpawn (AActor *pmo, DAngle angle, AActor *alttarget)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
player_t *player;
@ -167,7 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffPalette)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{

View File

@ -58,7 +58,7 @@ void APigPlayer::MorphPlayerThink ()
DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;

View File

@ -94,7 +94,7 @@ void P_DaggerAlert (AActor *target, AActor *emitter)
DEFINE_ACTION_FUNCTION(AActor, A_JabDagger)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -212,7 +212,7 @@ int APoisonBolt::DoSpecialDamage (AActor *target, int damage, FName damagetype)
DEFINE_ACTION_FUNCTION(AActor, A_ClearFlash)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player = self->player;
@ -231,7 +231,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ClearFlash)
DEFINE_ACTION_FUNCTION(AActor, A_ShowElectricFlash)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != nullptr)
{
@ -248,7 +248,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShowElectricFlash)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireArrow)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
PARAM_CLASS(ti, AActor);
DAngle savedangle;
@ -307,7 +307,7 @@ void P_StrifeGunShot (AActor *mo, bool accurate, DAngle pitch)
DEFINE_ACTION_FUNCTION(AActor, A_FireAssaultGun)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
bool accurate;
@ -343,7 +343,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireAssaultGun)
DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player = self->player;
DAngle savedangle;
@ -413,7 +413,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlameDie)
DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player = self->player;
@ -450,7 +450,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -494,7 +494,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler1)
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
S_Sound (self, CHAN_WEAPON, "weapons/mauler2charge", 1, ATTN_NORM);
@ -516,7 +516,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre)
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -688,7 +688,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
PARAM_CLASS(grenadetype, AActor);
PARAM_ANGLE(angleofs);
PARAM_STATE(flash)
@ -821,7 +821,7 @@ AInventory *ASigil::CreateCopy (AActor *other)
DEFINE_ACTION_FUNCTION(AActor, A_SelectPiece)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
int pieces = MIN (static_cast<ASigil*>(self)->NumPieces, 5);
@ -847,7 +847,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectPiece)
DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilView)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DPSprite *pspr;
int pieces;
@ -874,7 +874,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilView)
DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilDown)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DPSprite *pspr;
int pieces;
@ -904,7 +904,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilDown)
DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilAttack)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
DPSprite *pspr;
int pieces;
@ -927,7 +927,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SigilCharge)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
if (self->player != NULL)
@ -945,7 +945,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SigilCharge)
DEFINE_ACTION_FUNCTION(AActor, A_LightInverse)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -962,7 +962,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightInverse)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *spot;
player_t *player = self->player;
@ -1007,7 +1007,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil2)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player = self->player;
@ -1029,7 +1029,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil2)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *spot;
player_t *player = self->player;
@ -1063,7 +1063,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
AActor *spot;
player_t *player = self->player;
@ -1103,7 +1103,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil5)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player = self->player;

View File

@ -4643,7 +4643,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetLOS)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckForReload)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if ( self->player == NULL || self->player->ReadyWeapon == NULL )
{
@ -4696,7 +4696,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckForReload)
DEFINE_ACTION_FUNCTION(AActor, A_ResetReloadCounter)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player == NULL || self->player->ReadyWeapon == NULL)
return 0;

View File

@ -753,7 +753,7 @@ void DoReadyWeapon(AActor *self)
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_WeaponReady)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT_DEF(flags);
DoReadyWeaponToSwitch(self, !(flags & WRF_NoSwitch));
@ -885,7 +885,7 @@ static void P_CheckWeaponButtons (player_t *player)
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_ReFire)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
PARAM_STATE_DEF(state);
A_ReFire(self, state);
return 0;
@ -923,7 +923,7 @@ void A_ReFire(AActor *self, FState *state)
DEFINE_ACTION_FUNCTION(AInventory, A_ClearReFire)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player = self->player;
if (NULL != player)
@ -945,7 +945,7 @@ DEFINE_ACTION_FUNCTION(AInventory, A_ClearReFire)
DEFINE_ACTION_FUNCTION(AInventory, A_CheckReload)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -1133,7 +1133,7 @@ DEFINE_ACTION_FUNCTION(AActor, OverlayID)
DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
player_t *player = self->player;
DPSprite *psp;
@ -1181,7 +1181,7 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
DEFINE_ACTION_FUNCTION(AInventory, A_Raise)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
if (self == nullptr)
{
@ -1293,7 +1293,7 @@ enum GF_Flags
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_GunFlash)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
PARAM_STATE_DEF(flash);
PARAM_INT_DEF(flags);
@ -1381,42 +1381,9 @@ void P_GunShot (AActor *mo, bool accurate, PClassActor *pufftype, DAngle pitch)
P_LineAttack (mo, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Hitscan, pufftype);
}
DEFINE_ACTION_FUNCTION(AInventory, A_Light0)
{
PARAM_SELF_PROLOGUE(AActor);
if (self->player != NULL)
{
self->player->extralight = 0;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AInventory, A_Light1)
{
PARAM_SELF_PROLOGUE(AActor);
if (self->player != NULL)
{
self->player->extralight = 1;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AInventory, A_Light2)
{
PARAM_SELF_PROLOGUE(AActor);
if (self->player != NULL)
{
self->player->extralight = 2;
}
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_Light)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT(light);
if (self->player != NULL)

View File

@ -6007,6 +6007,24 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
PFunction *afd = FindClassMemberFunction(ctx.Class, ctx.Class, MethodName, ScriptPosition, &error);
// Action functions in state providers need special treatment because self is of type Actor here.
if (afd != nullptr && ctx.Class->IsDescendantOf(RUNTIME_CLASS(AStateProvider)) && (ctx.Function->Variants[0].Flags & VARF_Action))
{
// Only accept static and action functions from the current class. Calling a member function will require explicit use of 'invoker'.
if ((afd->Variants[0].Flags & (VARF_Method|VARF_Action)) == VARF_Method)
{
// Everything else that may be used here must pass the selfclass check, i.e. it must be reachable from Actor.
// Note that FuncClass is still the current item because for symbol privacy checks this is relevant.
afd = FindClassMemberFunction(ctx.Function->Variants[0].SelfClass, ctx.Class, MethodName, ScriptPosition, &error);
if (afd == nullptr)
{
ScriptPosition.Message(MSG_ERROR, "Unable to call non-action function %s from here. Please use 'invoker.%s' to call it.", MethodName.GetChars(), MethodName.GetChars());
delete this;
return nullptr;
}
}
}
if (error)
{
delete this;
@ -6306,7 +6324,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
isresolved:
bool error = false;
PFunction *afd = FindClassMemberFunction(cls, cls, MethodName, ScriptPosition, &error);
PFunction *afd = FindClassMemberFunction(cls, ctx.Class, MethodName, ScriptPosition, &error);
if (error)
{
delete this;

View File

@ -2317,7 +2317,14 @@ FxExpression *ZCCCompiler::SetupActionFunction(PClass *cls, ZCC_TreeNode *af)
{
FArgumentList argumentlist;
// We can use this function directly without wrapping it in a caller.
return new FxVMFunctionCall(new FxSelf(*af), afd, argumentlist, *af, false);
if ((afd->Variants[0].Flags & VARF_Action) || !cls->IsDescendantOf(RUNTIME_CLASS(AStateProvider)) || !afd->Variants[0].SelfClass->IsDescendantOf(RUNTIME_CLASS(AStateProvider)))
{
return new FxVMFunctionCall(new FxSelf(*af), afd, argumentlist, *af, false);
}
else
{
Error(af, "Cannot use non-action function %s here.", FName(id->Identifier).GetChars());
}
}
}
else

View File

@ -317,7 +317,6 @@ class Actor : Thinker native
native void A_Countdown();
native void A_AlertMonsters(float maxdist = 0, int flags = 0);
native void A_ClearSoundTarget();
native void A_FireAssaultGun();
native void A_CheckTerrain();
deprecated native void A_MissileAttack();

View File

@ -26,8 +26,8 @@ class Beak : Weapon
Weapon.SisterWeapon "BeakPowered";
}
native void A_BeakRaise ();
native void A_BeakAttackPL1();
action native void A_BeakRaise ();
action native void A_BeakAttackPL1();
States
{
@ -55,7 +55,7 @@ class BeakPowered : Beak
Weapon.SisterWeapon "Beak";
}
native void A_BeakAttackPL2();
action native void A_BeakAttackPL2();
States
{

View File

@ -23,7 +23,7 @@ class Staff : HereticWeapon
Tag "$TAG_STAFF";
}
native void A_StaffAttack (int damage, class<Actor> puff);
action native void A_StaffAttack (int damage, class<Actor> puff);
States
{
@ -142,7 +142,7 @@ class GoldWand : HereticWeapon
Tag "$TAG_GOLDWAND";
}
native void A_FireGoldWandPL1 ();
action native void A_FireGoldWandPL1 ();
States
{
@ -178,7 +178,7 @@ class GoldWandPowered : GoldWand
Tag "$TAG_GOLDWANDP";
}
native void A_FireGoldWandPL2 ();
action native void A_FireGoldWandPL2 ();
States
{
@ -294,7 +294,7 @@ class Crossbow : HereticWeapon
Tag "$TAG_CROSSBOW";
}
native void A_FireCrossbowPL1 ();
action native void A_FireCrossbowPL1 ();
States
{
@ -330,7 +330,7 @@ class CrossbowPowered : Crossbow
Tag "$TAG_CROSSBOWP";
}
native void A_FireCrossbowPL2();
action native void A_FireCrossbowPL2();
States
{
@ -462,7 +462,7 @@ class Gauntlets : Weapon
Obituary "$OB_MPGAUNTLETS";
}
native void A_GauntletAttack (int power);
action native void A_GauntletAttack (int power);
States
{
@ -574,7 +574,7 @@ class Mace : HereticWeapon
Tag "$TAG_MACE";
}
native void A_FireMacePL1();
action native void A_FireMacePL1();
States
{
@ -611,7 +611,7 @@ class MacePowered : Mace
Tag "$TAG_MACEP";
}
native void A_FireMacePL2();
action native void A_FireMacePL2();
States
{
@ -778,7 +778,7 @@ class Blaster : HereticWeapon
Obituary "$OB_MPBLASTER";
}
native void A_FireBlasterPL1();
action native void A_FireBlasterPL1();
States
{
@ -950,7 +950,7 @@ class SkullRod : HereticWeapon
Tag "$TAG_SKULLROD";
}
native void A_FireSkullRodPL1();
action native void A_FireSkullRodPL1();
States
{
@ -984,7 +984,7 @@ class SkullRodPowered : SkullRod
Tag "$TAG_SKULLRODP";
}
native void A_FireSkullRodPL2();
action native void A_FireSkullRodPL2();
States
{
@ -1140,7 +1140,7 @@ class PhoenixRod : Weapon native
Tag "$TAG_PHOENIXROD";
}
native void A_FirePhoenixPL1();
action native void A_FirePhoenixPL1();
States
{
@ -1176,9 +1176,9 @@ class PhoenixRodPowered : PhoenixRod native
Tag "$TAG_PHOENIXRODP";
}
native void A_InitPhoenixPL2();
native void A_FirePhoenixPL2();
native void A_ShutdownPhoenixPL2();
action native void A_InitPhoenixPL2();
action native void A_FirePhoenixPL2();
action native void A_ShutdownPhoenixPL2();
States
{

View File

@ -16,7 +16,7 @@ class CWeapFlame : ClericWeapon
Tag "$TAG_CWEAPFLAME";
}
native void A_CFlameAttack();
action native void A_CFlameAttack();
States
{

View File

@ -96,8 +96,8 @@ class CWeapWraithverge : ClericWeapon native
Inventory.PickupSound "WeaponBuild";
}
native void A_CHolyAttack();
native void A_CHolyPalette();
action native void A_CHolyAttack();
action native void A_CHolyPalette();
States
{

View File

@ -13,7 +13,7 @@ class CWeapMace : ClericWeapon
Tag "$TAG_CWEAPMACE";
}
native void A_CMaceAttack();
action native void A_CMaceAttack();
States
{

View File

@ -16,10 +16,10 @@ class CWeapStaff : ClericWeapon
Tag "$TAG_CWEAPSTAFF";
}
native void A_CStaffInitBlink();
native void A_CStaffCheckBlink();
native void A_CStaffCheck();
native void A_CStaffAttack();
action native void A_CStaffInitBlink();
action native void A_CStaffCheckBlink();
action native void A_CStaffCheck();
action native void A_CStaffAttack();
States
{

View File

@ -17,12 +17,12 @@ class FWeapAxe : FighterWeapon native
Tag "$TAG_FWEAPAXE";
}
native void A_FAxeCheckUp();
native void A_FAxeCheckReady();
native void A_FAxeCheckAtk();
native void A_FAxeAttack();
native void A_FAxeCheckUpG();
native void A_FAxeCheckReadyG();
action native void A_FAxeCheckUp();
action native void A_FAxeCheckReady();
action native void A_FAxeCheckAtk();
action native void A_FAxeAttack();
action native void A_FAxeCheckUpG();
action native void A_FAxeCheckReadyG();
States
{

View File

@ -13,7 +13,7 @@ class FWeapFist : FighterWeapon
Tag "$TAG_FWEAPFIST";
}
native void A_FPunchAttack();
action native void A_FPunchAttack();
States
{

View File

@ -18,8 +18,8 @@ class FWeapHammer : FighterWeapon
Tag "$TAG_FWEAPHAMMER";
}
native void A_FHammerAttack();
native void A_FHammerThrow();
action native void A_FHammerAttack();
action native void A_FHammerThrow();
States
{

View File

@ -97,7 +97,7 @@ class FWeapQuietus : FighterWeapon
Tag "$TAG_FWEAPQUIETUS";
}
native void A_FSwordAttack();
action native void A_FSwordAttack();
States
{

View File

@ -17,7 +17,7 @@ class MWeapFrost : MageWeapon
Tag "$TAG_MWEAPFROST";
}
native void A_FireConePL1();
action native void A_FireConePL1();
States
{

View File

@ -16,8 +16,8 @@ class MWeapLightning : MageWeapon
Tag "$TAG_MWEAPLIGHTNING";
}
native void A_LightningReady();
native void A_MLightningAttack(class<Actor> floor = "LightningFloor", class<Actor> ceiling = "LightningCeiling");
action native void A_LightningReady();
action native void A_MLightningAttack(class<Actor> floor = "LightningFloor", class<Actor> ceiling = "LightningCeiling");
States
{

View File

@ -97,8 +97,8 @@ class MWeapBloodscourge : MageWeapon native
Tag "$TAG_MWEAPBLOODSCOURGE";
}
native void A_MStaffAttack();
native void A_MStaffPalette();
action native void A_MStaffAttack();
action native void A_MStaffPalette();
States
{

View File

@ -34,7 +34,7 @@ class Snout : Weapon
Weapon.YAdjust 10;
}
native void A_SnoutAttack ();
action native void A_SnoutAttack ();
States
{

View File

@ -46,20 +46,22 @@ class StateProvider : Inventory native
action native void A_FireBullets(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", int flags = 1, float range = 0, class<Actor> missile = null, float Spawnheight = 32, float Spawnofs_xy = 0);
action native void A_FireCustomMissile(class<Actor> missiletype, float angle = 0, bool useammo = true, float spawnofs_xy = 0, float spawnheight = 0, int flags = 0, float pitch = 0);
action native void A_RailAttack(int damage, int spawnofs_xy = 0, bool useammo = true, color color1 = 0, color color2 = 0, int flags = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270, int limit = 0);
native void A_Light(int extralight);
native void A_Light0();
native void A_Light1();
native void A_Light2();
native void A_LightInverse();
native void A_WeaponReady(int flags = 0);
native void A_Lower();
native void A_Raise();
native action void A_Light(int extralight);
action void A_Light0() { A_Light(0); }
action void A_Light1() { A_Light(1); }
action void A_Light2() { A_Light(2); }
action native void A_LightInverse();
action native void A_WeaponReady(int flags = 0);
action native void A_Lower();
action native void A_Raise();
action native void A_FirePistol();
action native void A_FireShotgun();
action native void A_FireShotgun2();
native void A_OpenShotgun2();
native void A_LoadShotgun2();
native void A_CloseShotgun2();
action void A_OpenShotgun2() { A_PlaySound("weapons/sshoto", CHAN_WEAPON); }
action void A_LoadShotgun2() { A_PlaySound("weapons/sshotl", CHAN_WEAPON); }
action void A_CloseShotgun2() { A_PlaySound("weapons/sshotc", CHAN_WEAPON); }
action native void A_FireCGun();
action native void A_FireSTGrenade(class<Actor> grenadetype = "Grenade");
action native void A_FireMissile();
@ -67,17 +69,18 @@ class StateProvider : Inventory native
action native void A_FireRailgun();
action native void A_FireRailgunLeft();
action native void A_FireRailgunRight();
native void A_RailWait();
native void A_BFGsound();
action void A_RailWait() {}
action void A_BFGsound() { A_PlaySound("weapons/bfgf", CHAN_WEAPON); }
action native void A_FireBFG();
action native void A_FireOldBFG();
native void A_ReFire(state flash = null);
native void A_ClearReFire();
native void A_CheckReload();
native void A_GunFlash(state flash = null, int flags = 0);
action native void A_ReFire(state flash = null);
action native void A_ClearReFire();
action native void A_CheckReload();
action native void A_GunFlash(state flash = null, int flags = 0);
action native void A_FireAssaultGun();
action native void A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff", int flags = 0, float range = 0, float spread_xy = 2.8125, float spread_z = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus");
native state A_CheckForReload(int counter, state label, bool dontincrement = false);
native void A_ResetReloadCounter();
action native state A_CheckForReload(int counter, state label, bool dontincrement = false);
action native void A_ResetReloadCounter();
}
class ScoreItem : Inventory native

View File

@ -16,16 +16,16 @@ class Sigil : Weapon native
Inventory.PickupMessage "$TXT_SIGIL";
}
native void A_SelectPiece ();
native void A_SelectSigilView ();
native void A_SelectSigilDown ();
native void A_SelectSigilAttack ();
native void A_SigilCharge ();
native void A_FireSigil1 ();
native void A_FireSigil2 ();
native void A_FireSigil3 ();
native void A_FireSigil4 ();
native void A_FireSigil5 ();
action native void A_SelectPiece ();
action native void A_SelectSigilView ();
action native void A_SelectSigilDown ();
action native void A_SelectSigilAttack ();
action native void A_SigilCharge ();
action native void A_FireSigil1 ();
action native void A_FireSigil2 ();
action native void A_FireSigil3 ();
action native void A_FireSigil4 ();
action native void A_FireSigil5 ();
States
{

View File

@ -62,7 +62,7 @@ class PunchDagger : StrifeWeapon
Tag "$TAG_PUNCHDAGGER";
}
native void A_JabDagger ();
action native void A_JabDagger ();
States
{
@ -184,9 +184,9 @@ class StrifeCrossbow : StrifeWeapon
Inventory.Icon "CBOWA0";
}
native void A_ClearFlash ();
native void A_ShowElectricFlash ();
native void A_FireArrow (class<Actor> proj);
action native void A_ClearFlash ();
action native void A_ShowElectricFlash ();
action native void A_FireArrow (class<Actor> proj);
States
{
@ -331,7 +331,7 @@ class MiniMissileLauncher : StrifeWeapon
Inventory.PickupMessage "$TXT_MMLAUNCHER";
}
native void A_FireMiniMissile ();
action native void A_FireMiniMissile ();
States
{
@ -446,7 +446,7 @@ class FlameThrower : StrifeWeapon
Inventory.PickupMessage "$TXT_FLAMER";
}
native void A_FireFlamer ();
action native void A_FireFlamer ();
States
{
@ -528,7 +528,7 @@ class Mauler : StrifeWeapon
Obituary "$OB_MPMAULER1";
}
native void A_FireMauler1 ();
action native void A_FireMauler1 ();
States
{
@ -571,8 +571,8 @@ class Mauler2 : Mauler
Tag "$TAG_MAULER2";
}
native void A_FireMauler2Pre ();
native void A_FireMauler2 ();
action native void A_FireMauler2Pre ();
action native void A_FireMauler2 ();
States
{
@ -816,7 +816,7 @@ class StrifeGrenadeLauncher : StrifeWeapon
Inventory.PickupMessage "$TXT_GLAUNCHER";
}
native void A_FireGrenade (class<Actor> grenadetype, float angleofs, state flash);
action native void A_FireGrenade (class<Actor> grenadetype, float angleofs, state flash);
States
{