speculative bug fix. please don't break

This commit is contained in:
hermansimensen 2021-05-09 05:48:06 +02:00
parent c6af8a5f16
commit 0f286a13ef

View File

@ -280,9 +280,6 @@ public Action OnTrigger(const char[] output, int caller, int activator, float de
int FindEntityByName(int startEntity, char[] targetname, int searchingEnt, int activator, int caller)
{
if(!IsValidEntity(activator) || !IsValidEntity(caller) || !IsValidEntity(searchingEnt))
return -1;
Address targetEntityAddr = SDKCall(g_hFindEntityByName, startEntity, targetname, searchingEnt, activator, caller, 0);
if(targetEntityAddr == Address_Null)
@ -295,6 +292,9 @@ public void ServiceEvent(event_t event)
{
int targetEntity = -1;
if(!IsValidEntity(event.caller))
event.caller = 0;
// In the context of the event, the searching entity is also the caller
while ((targetEntity = FindEntityByName(targetEntity, event.target, event.caller, event.activator, event.caller)) != -1)
{