clone handle for calling plugin

This commit is contained in:
Joe 2021-04-05 18:21:18 +00:00 committed by GitHub
parent d321cec549
commit abd470996d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -366,10 +366,16 @@ public any Native_GetClientEvents(Handle plugin, int numParams)
int client = GetNativeCell(1);
if(client < 0 || client > MaxClients || !IsClientConnected(client) || !IsClientInGame(client) || IsClientSourceTV(client))
return false;
ArrayList pe = g_aPlayerEvents[client].Clone();
ArrayList ow = g_aOutputWait[client].Clone();
eventpack_t ep;
ep.playerEvents = g_aPlayerEvents[client].Clone();
ep.outputWaits = g_aOutputWait[client].Clone();
ep.playerEvents = view_as<ArrayList>(CloneHandle(pe, plugin));
ep.outputWaits = view_as<ArrayList>(CloneHandle(ow, plugin));
delete pe;
delete ow;
SetNativeArray(2, ep, sizeof(eventpack_t));
return true;