From 3d6f5dc51bd1c782c947fbd791fef7cd96790b1a Mon Sep 17 00:00:00 2001 From: Yui <50331474+SirYodaJedi@users.noreply.github.com> Date: Sat, 15 Aug 2026 17:10:58 -0400 Subject: [PATCH 1/3] fix trigger_wind brush rotation --- src/game/server/triggers.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/game/server/triggers.cpp b/src/game/server/triggers.cpp index bc50b00dc3b..32847b79d63 100644 --- a/src/game/server/triggers.cpp +++ b/src/game/server/triggers.cpp @@ -3849,7 +3849,7 @@ BEGIN_DATADESC( CTriggerWind ) DEFINE_FIELD( m_nSpeedCurrent, FIELD_INTEGER), DEFINE_FIELD( m_nSpeedTarget, FIELD_INTEGER), - DEFINE_FIELD( m_nDirBase, FIELD_INTEGER), + DEFINE_KEYFIELD( m_nDirBase, FIELD_INTEGER, "WindAngle"), DEFINE_FIELD( m_nDirCurrent, FIELD_INTEGER), DEFINE_FIELD( m_nDirTarget, FIELD_INTEGER), DEFINE_FIELD( m_bSwitch, FIELD_BOOLEAN), @@ -3869,6 +3869,14 @@ BEGIN_DATADESC( CTriggerWind ) END_DATADESC() +//------------------------------------------------------------------------------ +// Purpose: Constructor for trigger_wind +//------------------------------------------------------------------------------ +CTriggerWind::CTriggerWind() +{ + // assign default values + m_nDirBase = -1; +} //------------------------------------------------------------------------------ // Purpose: @@ -3876,8 +3884,19 @@ END_DATADESC() void CTriggerWind::Spawn( void ) { m_bSwitch = true; - m_nDirBase = GetLocalAngles().y; - + if (m_nDirBase >= 0) + { + // negative "WindAngle" (default) means use the old method and grab + // from "angles" instead (has the unintended side effect of rotating + // the trigger; not fixing in order to not break existing maps) + m_nDirBase = GetLocalAngles().y; + } + else + { + // rotate wind to match brush rotation. fixes rotated instances, + // as long as they're only rotated around Z (yaw) axis + m_nDirBase += (GetLocalAngles().y); + } BaseClass::Spawn(); m_nSpeedCurrent = m_nSpeedBase; From e20f0fa1c426477d721aa2aa30012e6a45d228ad Mon Sep 17 00:00:00 2001 From: Yui <50331474+SirYodaJedi@users.noreply.github.com> Date: Sat, 15 Aug 2026 21:49:40 -0400 Subject: [PATCH 2/3] add SetWindAngle input to trigger_wind --- src/game/server/triggers.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game/server/triggers.cpp b/src/game/server/triggers.cpp index 32847b79d63..28075b23be9 100644 --- a/src/game/server/triggers.cpp +++ b/src/game/server/triggers.cpp @@ -3821,6 +3821,7 @@ class CTriggerWind : public CBaseVPhysicsTrigger // Input handlers void InputEnable( inputdata_t &inputdata ); void InputSetSpeed( inputdata_t &inputdata ); + void InputSetWindAngle( inputdata_t &inputdata); private: int m_nSpeedBase; // base line for how hard the wind blows @@ -3866,6 +3867,7 @@ BEGIN_DATADESC( CTriggerWind ) DEFINE_FUNCTION( WindThink ), DEFINE_INPUTFUNC( FIELD_INTEGER, "SetSpeed", InputSetSpeed ), + DEFINE_INPUTFUNC( FIELD_INTEGER, "SetWindAngle", InputSetWindAngle ), END_DATADESC() @@ -4074,6 +4076,14 @@ void CTriggerWind::InputSetSpeed( inputdata_t &inputdata ) m_bSwitch = true; } +//------------------------------------------------------------------------------ +// Purpose: set new wind angle and mark to switch next think +//------------------------------------------------------------------------------ +void CTriggerWind::InputSetWindAngle( inputdata_t &inputdata ) +{ + m_nDirBase = (inputdata.value.int() + GetLocalAngles().y); + m_bSwitch = true; +} //----------------------------------------------------------------------------- // Purpose: Draw any debug text overlays From 96d4a22954bfc18f1798e9da0d1a13ae7bdc00bc Mon Sep 17 00:00:00 2001 From: Yui <50331474+SirYodaJedi@users.noreply.github.com> Date: Sat, 15 Aug 2026 21:53:13 -0400 Subject: [PATCH 3/3] fix typo in InputSetWindAngle() --- src/game/server/triggers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/server/triggers.cpp b/src/game/server/triggers.cpp index 28075b23be9..738c30f2994 100644 --- a/src/game/server/triggers.cpp +++ b/src/game/server/triggers.cpp @@ -4081,7 +4081,7 @@ void CTriggerWind::InputSetSpeed( inputdata_t &inputdata ) //------------------------------------------------------------------------------ void CTriggerWind::InputSetWindAngle( inputdata_t &inputdata ) { - m_nDirBase = (inputdata.value.int() + GetLocalAngles().y); + m_nDirBase = (inputdata.value.Int() + GetLocalAngles().y); m_bSwitch = true; }