Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/game/server/cbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,8 @@ class CEventQueue_SaveRestoreBlockHandler : public CDefSaveRestoreBlockHandler

CEventQueue_SaveRestoreBlockHandler g_EventQueue_SaveRestoreBlockHandler;

EventQueuePrioritizedEvent_t *m_pServiceEvent = NULL;

//-------------------------------------

ISaveRestoreBlockHandler *GetEventQueueSaveRestoreBlockHandler()
Expand All @@ -879,6 +881,7 @@ void CEventQueue::Clear( void )
}

m_Events.m_pNext = NULL;
m_pServiceEvent = NULL;
}

void CEventQueue::Dump( void )
Expand Down Expand Up @@ -1045,6 +1048,8 @@ void CEventQueue::ServiceEvents( void )
{
MDLCACHE_CRITICAL_SECTION();

m_pServiceEvent = pe;

bool targetFound = false;

// find the targets
Expand Down Expand Up @@ -1128,6 +1133,7 @@ void CEventQueue::ServiceEvents( void )
}

// remove the event from the list (remembering that the queue may have been added to)
m_pServiceEvent = NULL;
RemoveEvent( pe );
delete pe;

Expand Down Expand Up @@ -1176,7 +1182,7 @@ void CEventQueue::CancelEvents( CBaseEntity *pCaller )
while (pCur != NULL)
{
bool bDelete = false;
if (pCur->m_pCaller == pCaller)
if (pCur->m_pCaller == pCaller && pCur != m_pServiceEvent)
{
// Pointers match; make sure everything else matches.
if (!stricmp(STRING(pCur->m_pCaller->GetEntityName()), STRING(pCaller->GetEntityName())) &&
Expand Down Expand Up @@ -1214,7 +1220,7 @@ void CEventQueue::CancelEventOn( CBaseEntity *pTarget, const char *sInputName )
while (pCur != NULL)
{
bool bDelete = false;
if (pCur->m_pEntTarget == pTarget)
if (pCur->m_pEntTarget == pTarget && pCur != m_pServiceEvent)
{
if ( !Q_strncmp( STRING(pCur->m_iTargetInput), sInputName, strlen(sInputName) ) )
{
Expand Down Expand Up @@ -1290,7 +1296,7 @@ void CEventQueue::CancelEventsByInput( CBaseEntity *pTarget, const char *szInput
{
bool bRemove = false;

if ( pTarget == pCur->m_pEntTarget || pCur->m_iTarget == iszDebugName )
if ( ( pTarget == pCur->m_pEntTarget || pCur->m_iTarget == iszDebugName ) && pCur != m_pServiceEvent )
{
if ( !V_strncmp( STRING(pCur->m_iTargetInput), szInput, strlen(szInput) ) )
{
Expand Down
Loading