another wait time fix

This commit is contained in:
hermansimensen 2021-03-12 01:46:15 +01:00
parent d55cb3b4cc
commit 442947fbce

View File

@ -34,7 +34,6 @@ enum struct event_t
enum struct entity_t enum struct entity_t
{ {
int outputID; int outputID;
int caller;
float waitTime; float waitTime;
} }
@ -244,13 +243,10 @@ public MRESReturn DHook_AddEventThree(Handle hParams)
{ {
g_aOutputWait[event.activator].GetArray(i, ent); 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;
}
} }
} }
@ -262,6 +258,13 @@ public MRESReturn DHook_AddEventThree(Handle hParams)
ent.waitTime = m_flWait; ent.waitTime = m_flWait;
g_aOutputWait[event.activator].PushArray(ent); g_aOutputWait[event.activator].PushArray(ent);
} }
else
{
if(ent.waitTime <= 0.0)
{
g_aPlayerEvents[event.activator].PushArray(event);
}
}
return MRES_Supercede; return MRES_Supercede;
} }
@ -304,6 +307,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
int targetEntity; int targetEntity;
if(!strcmp("!activator", event.target, false)) if(!strcmp("!activator", event.target, false))
{ {
targetEntity = event.activator; targetEntity = event.activator;