From c29ece75db0ef3fd47e82fa58ad38a4d11407774 Mon Sep 17 00:00:00 2001 From: WereTech <17415815+WereTech@users.noreply.github.com> Date: Sat, 8 Nov 2025 01:22:48 -0600 Subject: [PATCH] Add SetTarget input to tf_glow to allow an easy way to change its glow target at runtime Currently, this cannot be done through AddOutput. Another method of achieving this is through using VScript by setting the m_hTarget through its netprop. --- src/game/server/tf/tf_glow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/game/server/tf/tf_glow.cpp b/src/game/server/tf/tf_glow.cpp index 281047ba7a8..b13cc552f22 100644 --- a/src/game/server/tf/tf_glow.cpp +++ b/src/game/server/tf/tf_glow.cpp @@ -22,6 +22,7 @@ class CTFGlow : public CBaseEntity void InputEnable( inputdata_t &inputdata ); void InputDisable( inputdata_t &inputdata ); void InputSetGlowColor( inputdata_t &inputdata ); + void InputSetTarget( inputdata_t &inputdata ); private: CNetworkVar( int, m_iMode ); @@ -39,6 +40,7 @@ BEGIN_DATADESC( CTFGlow ) DEFINE_INPUTFUNC( FIELD_VOID, "Enable", InputEnable ), DEFINE_INPUTFUNC( FIELD_VOID, "Disable", InputDisable ), DEFINE_INPUTFUNC( FIELD_COLOR32, "SetGlowColor", InputSetGlowColor ), + DEFINE_INPUTFUNC( FIELD_STRING, "SetTarget", InputSetTarget ) END_DATADESC() //----------------------------------------------------------------------------- @@ -89,6 +91,16 @@ void CTFGlow::InputSetGlowColor( inputdata_t &inputdata ) m_glowColor = inputdata.value.Color32(); // clients will take action } +//----------------------------------------------------------------------------- +void CTFGlow::InputSetTarget( inputdata_t &inputdata ) +{ + CBaseEntity *pEnt = gEntList.FindEntityByName( nullptr, inputdata.value.String() ); + if ( pEnt ) + { + m_hTarget = pEnt; + } +} + //----------------------------------------------------------------------------- int CTFGlow::UpdateTransmitState() {