From 3c59cbd819953cefc25b3955bd6225f89235d8a5 Mon Sep 17 00:00:00 2001 From: WereTech <17415815+WereTech@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:12:37 -0600 Subject: [PATCH 1/2] Fix cancelpending causing a crash when a logic_relay fires this to itself Check that the input caller is not the logic_relay itself. --- src/game/server/logicrelay.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/server/logicrelay.cpp b/src/game/server/logicrelay.cpp index b556ec04f15..52242577deb 100644 --- a/src/game/server/logicrelay.cpp +++ b/src/game/server/logicrelay.cpp @@ -110,7 +110,11 @@ void CLogicRelay::InputEnableRefire( inputdata_t &inputdata ) //------------------------------------------------------------------------------ void CLogicRelay::InputCancelPending( inputdata_t &inputdata ) { - g_EventQueue.CancelEvents( this ); + // We don't want to allow the logic relay to cancelpending itself. This will eventually lead to a crash! + if ( inputdata.pCaller != this ) + { + g_EventQueue.CancelEvents( this ); + } // Stop waiting; allow another Trigger. m_bWaitForRefire = false; From 7f886ff55d0266abcba8a8c3a400bbee6f9060a0 Mon Sep 17 00:00:00 2001 From: WereTech <17415815+WereTech@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:36:36 -0600 Subject: [PATCH 2/2] add warning message if logic relay is attempting to cancelpending itself --- src/game/server/logicrelay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/server/logicrelay.cpp b/src/game/server/logicrelay.cpp index 52242577deb..25518ca5f37 100644 --- a/src/game/server/logicrelay.cpp +++ b/src/game/server/logicrelay.cpp @@ -115,6 +115,10 @@ void CLogicRelay::InputCancelPending( inputdata_t &inputdata ) { g_EventQueue.CancelEvents( this ); } + else + { + Warning("Entity %s - (%s) is attempting to CancelPending itself. This is not allowed!\n", this->GetEntityName(), this->GetClassname()); + } // Stop waiting; allow another Trigger. m_bWaitForRefire = false;