From 442947fbced28333677f92dfdb7966e3ce7a224d Mon Sep 17 00:00:00 2001 From: hermansimensen Date: Fri, 12 Mar 2021 01:46:15 +0100 Subject: [PATCH] another wait time fix --- scripting/eventqueuefix.sp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripting/eventqueuefix.sp b/scripting/eventqueuefix.sp index be8ed12..6c66948 100644 --- a/scripting/eventqueuefix.sp +++ b/scripting/eventqueuefix.sp @@ -34,7 +34,6 @@ enum struct event_t enum struct entity_t { int outputID; - int caller; float waitTime; } @@ -244,24 +243,28 @@ public MRESReturn DHook_AddEventThree(Handle hParams) { g_aOutputWait[event.activator].GetArray(i, ent); - if(ent.caller == event.caller) + if(ent.outputID == event.outputID) { - if(ent.outputID == event.outputID) - { - bFound = true; - break; - } + bFound = true; + break; } } if(!bFound) { g_aPlayerEvents[event.activator].PushArray(event); - + ent.outputID = event.outputID; ent.waitTime = m_flWait; g_aOutputWait[event.activator].PushArray(ent); } + else + { + if(ent.waitTime <= 0.0) + { + g_aPlayerEvents[event.activator].PushArray(event); + } + } return MRES_Supercede; } @@ -304,6 +307,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 int targetEntity; + if(!strcmp("!activator", event.target, false)) { targetEntity = event.activator;