From 70c2a6e5e7c9ec767fcf6e16c443b1cc68e12a7d Mon Sep 17 00:00:00 2001 From: -_YoYo178_- <95132723+YoYo178@users.noreply.github.com> Date: Sun, 30 Jun 2024 21:31:11 +0530 Subject: [PATCH] Fix #34 actually this time --- mp/src/game/server/cbase.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mp/src/game/server/cbase.cpp b/mp/src/game/server/cbase.cpp index 8cfdd83c..882a0358 100644 --- a/mp/src/game/server/cbase.cpp +++ b/mp/src/game/server/cbase.cpp @@ -285,7 +285,13 @@ void CBaseEntityOutput::FireOutput(variant_t Value, CBaseEntity *pActivator, CBa // // Post the event with the default parameter. // - g_EventQueue.AddEvent( STRING(ev->m_iTarget), STRING(ev->m_iTargetInput), Value, ev->m_flDelay + fDelay, pActivator, pCaller, ev->m_iIDStamp ); + if ( pCaller && ( pCaller->Classify() == CLASS_TRIGGER || pCaller->Classify() == CLASS_TRIGGERSCRIPT || pCaller->Classify() == CLASS_TRIGGER_CLIP ) + && pCaller->GetName() == STRING( ev->m_iTarget ) ) + { + g_EventQueue.AddEvent( pCaller, STRING(ev->m_iTargetInput), Value, ev->m_flDelay + fDelay, pActivator, pCaller, ev->m_iIDStamp ); + } + else + g_EventQueue.AddEvent( STRING(ev->m_iTarget), STRING(ev->m_iTargetInput), Value, ev->m_flDelay + fDelay, pActivator, pCaller, ev->m_iIDStamp ); } else { @@ -294,7 +300,14 @@ void CBaseEntityOutput::FireOutput(variant_t Value, CBaseEntity *pActivator, CBa // variant_t ValueOverride; ValueOverride.SetString( ev->m_iParameter ); - g_EventQueue.AddEvent( STRING(ev->m_iTarget), STRING(ev->m_iTargetInput), ValueOverride, ev->m_flDelay, pActivator, pCaller, ev->m_iIDStamp ); + + if ( pCaller && ( pCaller->Classify() == CLASS_TRIGGER || pCaller->Classify() == CLASS_TRIGGERSCRIPT || pCaller->Classify() == CLASS_TRIGGER_CLIP ) + && pCaller->GetName() == STRING( ev->m_iTarget ) ) + { + g_EventQueue.AddEvent( pCaller, STRING(ev->m_iTargetInput), ValueOverride, ev->m_flDelay, pActivator, pCaller, ev->m_iIDStamp ); + } + else + g_EventQueue.AddEvent( STRING(ev->m_iTarget), STRING(ev->m_iTargetInput), ValueOverride, ev->m_flDelay, pActivator, pCaller, ev->m_iIDStamp ); } if ( ev->m_flDelay )