From 60a411c9adcda2c95eedfca4d812f9bacad65c3a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 26 May 2011 23:29:36 +0000 Subject: [PATCH] - added A_GunFlash extension submission. SVN r3217 (trunk) --- src/p_pspr.cpp | 10 ++++++++-- wadsrc/static/actors/constants.txt | 3 +++ wadsrc/static/actors/shared/inventory.txt | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 606acdb26..8b8c5bcdc 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -660,10 +660,16 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Raise) // // A_GunFlash // +enum GF_Flags +{ + GFF_NOEXTCHANGE = 1, +}; + DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_GunFlash) { - ACTION_PARAM_START(1) + ACTION_PARAM_START(2) ACTION_PARAM_STATE(flash, 0); + ACTION_PARAM_INT(Flags, 1); player_t *player = self->player; @@ -671,7 +677,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_GunFlash) { return; } - player->mo->PlayAttacking2 (); + if(!(Flags & GFF_NOEXTCHANGE)) player->mo->PlayAttacking2 (); if (flash == NULL) { diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index c5159bbf7..7a65c3d9d 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -19,6 +19,9 @@ const int CBAF_NORANDOM = 2; const int CBAF_EXPLICITANGLE = 4; const int CBAF_NOPITCH = 8; +// Flags for A_GunFlash +const int GFF_NOEXTCHANGE = 1; + // Flags for A_FireBullets const int FBF_USEAMMO = 1; const int FBF_NORANDOM = 2; diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index 49b6b39a2..3088ffff0 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -40,7 +40,7 @@ ACTOR Inventory native action native A_ReFire(state flash = ""); action native A_ClearReFire(); action native A_CheckReload(); - action native A_GunFlash(state flash = ""); + action native A_GunFlash(state flash = "", int flags = 0); action native A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class pufftype = "BulletPuff", int flags = 0, float range = 0, float spread_xy = 2.8125, float spread_z = 0, float lifesteal = 0); action native A_CheckForReload(int counter, state label, bool dontincrement = false); action native A_ResetReloadCounter();