mirror of
https://github.com/hermansimensen/eventqueue-fix.git
synced 2025-12-07 10:28:25 +00:00
Merge pull request #6 from rtldg/stuff
stop crashing on bhop_fps_max_sr and stuff
This commit is contained in:
commit
34e3904b2a
@ -135,19 +135,11 @@ public void OnClientPutInServer(int client)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClientDisconnect(int client)
|
public void OnClientDisconnect_Post(int client)
|
||||||
{
|
{
|
||||||
if(g_aPlayerEvents[client] != null)
|
delete g_aPlayerEvents[client];
|
||||||
{
|
|
||||||
g_aPlayerEvents[client].Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(g_aOutputWait[client] != null)
|
|
||||||
{
|
|
||||||
g_aOutputWait[client].Clear();
|
|
||||||
delete g_aOutputWait[client];
|
delete g_aOutputWait[client];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void OnEntityCreated(int entity, const char[] classname)
|
public void OnEntityCreated(int entity, const char[] classname)
|
||||||
{
|
{
|
||||||
@ -224,12 +216,18 @@ int EntityToBCompatRef(Address player)
|
|||||||
public MRESReturn DHook_AddEventThree(Handle hParams)
|
public MRESReturn DHook_AddEventThree(Handle hParams)
|
||||||
{
|
{
|
||||||
event_t event;
|
event_t event;
|
||||||
|
event.activator = EntRefToEntIndex(EntityToBCompatRef(view_as<Address>(DHookGetParam(hParams, 5))));
|
||||||
|
|
||||||
|
if (event.activator < 1 || event.activator > MaxClients)
|
||||||
|
{
|
||||||
|
return MRES_Ignored;
|
||||||
|
}
|
||||||
|
|
||||||
DHookGetParamString(hParams, 1, event.target, 64);
|
DHookGetParamString(hParams, 1, event.target, 64);
|
||||||
DHookGetParamString(hParams, 2, event.targetInput, 64);
|
DHookGetParamString(hParams, 2, event.targetInput, 64);
|
||||||
DHookGetParamObjectPtrString(hParams, 3, 0, ObjectValueType_String, event.variantValue, sizeof(event.variantValue));
|
DHookGetParamObjectPtrString(hParams, 3, 0, ObjectValueType_String, event.variantValue, sizeof(event.variantValue));
|
||||||
int ticks = RoundToCeil((view_as<float>(DHookGetParam(hParams, 4)) - FLT_EPSILON) / GetTickInterval());
|
int ticks = RoundToCeil((view_as<float>(DHookGetParam(hParams, 4)) - FLT_EPSILON) / GetTickInterval());
|
||||||
event.delay = float(ticks);
|
event.delay = float(ticks);
|
||||||
event.activator = EntRefToEntIndex(EntityToBCompatRef(view_as<Address>(DHookGetParam(hParams, 5))));
|
|
||||||
event.caller = EntRefToEntIndex(EntityToBCompatRef(view_as<Address>(DHookGetParam(hParams, 6))));
|
event.caller = EntRefToEntIndex(EntityToBCompatRef(view_as<Address>(DHookGetParam(hParams, 6))));
|
||||||
event.outputID = DHookGetParam(hParams, 7);
|
event.outputID = DHookGetParam(hParams, 7);
|
||||||
|
|
||||||
@ -237,15 +235,10 @@ public MRESReturn DHook_AddEventThree(Handle hParams)
|
|||||||
PrintToChatAll("AddEventThree: %s, %s, %s, %f, %i, %i, %i, time: %f", event.target, event.targetInput, event.variantValue, event.delay, event.activator, event.caller, event.outputID, GetGameTime());
|
PrintToChatAll("AddEventThree: %s, %s, %s, %f, %i, %i, %i, time: %f", event.target, event.targetInput, event.variantValue, event.delay, event.activator, event.caller, event.outputID, GetGameTime());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if((event.activator < 65 && event.activator > 0))
|
|
||||||
{
|
|
||||||
g_aPlayerEvents[event.activator].PushArray(event);
|
g_aPlayerEvents[event.activator].PushArray(event);
|
||||||
return MRES_Supercede;
|
return MRES_Supercede;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MRES_Ignored;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Action OnTrigger(const char[] output, int caller, int activator, float delay)
|
public Action OnTrigger(const char[] output, int caller, int activator, float delay)
|
||||||
{
|
{
|
||||||
if(activator <= MAXPLAYERS && activator > 0)
|
if(activator <= MAXPLAYERS && activator > 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user