-
Notifications
You must be signed in to change notification settings - Fork 1
/
cbase.cpp.txt
45 lines (41 loc) · 931 Bytes
/
cbase.cpp.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
void CBaseEntityOutput::ScriptRemoveEventAction( CEventAction *pEventAction, const char *szTarget, const char *szTargetInput, const char *szParameter )
{
CEventAction *ev = m_ActionList;
CEventAction *prev = NULL;
bool bTargetOnly = false;
if ( V_strcmp( szTargetInput, "" ) == 0 )
bTargetOnly = true;
while (ev != NULL)
{
bool bRemove = false;
if ( bTargetOnly )
{
if ( ev->m_iTarget == AllocPooledString( szTarget ) )
bRemove = true;
}
else
{
if ( ev->m_iTarget == AllocPooledString( szTarget ) && ev->m_iTargetInput == AllocPooledString( szTargetInput ) && ev->m_iParameter == AllocPooledString( szParameter ) )
bRemove = true;
}
if (!bRemove)
{
prev = ev;
ev = ev->m_pNext;
}
else
{
if (prev != NULL)
{
prev->m_pNext = ev->m_pNext;
}
else
{
m_ActionList = ev->m_pNext;
}
CEventAction *next = ev->m_pNext;
delete ev;
ev = next;
}
}
}