Optimized calls to Event() (avoid allocating a new Event when it can be reused)

This commit is contained in:
smallmodel committed 2023-09-07 18:22:07 +02:00
1 parent 47a3c0bf55
commit c5a46be23e
16 files changed
+195 -146

No files matched your search

+3 -5
View File
@@ -175,12 +175,10 @@ void ScriptTimer::Disable()
void ScriptTimer::Enable()
{
bEnabled = true;
bEnabled = true;
CancelEventsOfType( &EV_ScriptTimer_Think );
Event *ev = new Event( &EV_ScriptTimer_Think );
ProcessEvent( ev );
CancelEventsOfType(EV_ScriptTimer_Think);
ProcessEvent(EV_ScriptTimer_Think);
}
qboolean ScriptTimer::Done()