- 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:
parent
7d49a82963
commit
a2f4cd7cda
38 changed files with 185 additions and 237 deletions
|
|
@ -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
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void ACFlameMissile::Effect ()
|
|||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
|
||||
player_t *player;
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue