diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index b9ba6b932..0f01522d1 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -143,7 +143,7 @@ DPSprite::DPSprite(player_t *owner, AInventory *caller, int id) Next->Destroy(); // Replace it. if (Caller->IsKindOf(RUNTIME_CLASS(AWeapon))) - Flags = (PSPF_ADDWEAPON|PSPF_ADDBOB); + Flags = (PSPF_ADDWEAPON|PSPF_ADDBOB|PSPF_POWDOUBLE|PSPF_CVARFAST); } //------------------------------------------------------------------------ @@ -210,6 +210,10 @@ DPSprite *player_t::GetPSprite(PSPLayers layer) if (newcaller != oldcaller) { // Only change the flags if this layer was created now or if we updated the caller. + if (layer >= PSP_TARGETCENTER) + { // The targeter layers were affected by those. + pspr->Flags |= (PSPF_CVARFAST|PSPF_POWDOUBLE); + } if (layer != PSP_FLASH) { // Only the flash layer should follow the weapon. pspr->Flags &= ~PSPF_ADDWEAPON; @@ -286,7 +290,7 @@ void DPSprite::SetState(FState *newstate, bool pending) Tics = newstate->GetTics(); // could be 0 - if (Caller->IsKindOf(RUNTIME_CLASS(AWeapon))) + if (Flags & PSPF_CVARFAST) { if (sv_fastweapons == 2 && ID == PSP_WEAPON) Tics = newstate->ActionFunc == nullptr ? 0 : 1; @@ -1358,7 +1362,7 @@ void DPSprite::Tick() Tics--; // [BC] Apply double firing speed. - if (Caller->IsKindOf(RUNTIME_CLASS(AWeapon)) && Tics && Owner->cheats & CF_DOUBLEFIRINGSPEED) + if ((Flags & PSPF_POWDOUBLE) && Tics && (Owner->cheats & CF_DOUBLEFIRINGSPEED)) Tics--; if (!Tics) diff --git a/src/p_pspr.h b/src/p_pspr.h index c3400f43d..9ef3208e5 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -55,6 +55,8 @@ enum PSPFlags { PSPF_ADDWEAPON = 1 << 0, PSPF_ADDBOB = 1 << 1, + PSPF_POWDOUBLE = 1 << 2, + PSPF_CVARFAST = 1 << 3, }; class DPSprite : public DObject diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index d65e9e463..4bd2dc199 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -575,6 +575,8 @@ enum { PSPF_ADDWEAPON = 1 << 0, PSPF_ADDBOB = 1 << 1, + PSPF_POWDOUBLE = 1 << 2, + PSPF_CVARFAST = 1 << 3, }; // Default psprite layers