From d5f679be6d065b128ad84fbd44fc30493dea0203 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 21 Sep 2024 13:00:07 +0300 Subject: [PATCH] Add "Don't delay first fire" spawnflag for env_blowercannon --- dlls/effects.cpp | 5 ++++- fgd/halflife.fgd | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/effects.cpp b/dlls/effects.cpp index fc57c92b6..e50fee5c5 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -3657,6 +3657,8 @@ enum BLOWERCANNON_FIRE, }; +#define SF_BLOWERCANNON_NO_FIRST_DELAY 32 + class CBlowerCannon : public CBaseDelay { public: @@ -3769,7 +3771,8 @@ void CBlowerCannon::BlowerCannonStart( CBaseEntity *pActivator, CBaseEntity *pCa m_hActivator = pActivator; SetUse( &CBlowerCannon::BlowerCannonStop ); SetThink( &CBlowerCannon::BlowerCannonThink ); - pev->nextthink = gpGlobals->time + m_flDelay; + const float delay = FBitSet(pev->spawnflags, SF_BLOWERCANNON_NO_FIRST_DELAY) ? 0.0f : m_flDelay; + pev->nextthink = gpGlobals->time + delay; } void CBlowerCannon::BlowerCannonStop( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) diff --git a/fgd/halflife.fgd b/fgd/halflife.fgd index 8312d54a3..066c64db0 100644 --- a/fgd/halflife.fgd +++ b/fgd/halflife.fgd @@ -1686,6 +1686,10 @@ 1: "Toggle On/Off" 2: "Fire When Triggered" ] + spawnflags(flags) = + [ + 32: "Don't delay first fire" : 0 + ] ] @SolidClass base(Targetname) = env_bubbles : "Bubble Volume"