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

This commit is contained in:
smallmodel 2023-09-07 18:21:03 +02:00
parent 47a3c0bf55
commit c5a46be23e
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
16 changed files with 195 additions and 146 deletions

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()