diff --git a/scripting/eventqueuefix.sp b/scripting/eventqueuefix.sp index c346136..908c985 100644 --- a/scripting/eventqueuefix.sp +++ b/scripting/eventqueuefix.sp @@ -332,12 +332,19 @@ public void ServiceEvent(event_t event) } bool byTargetname = false; + int attemptCount = 0; // In the context of the event, the searching entity is also the caller while ((targetEntity = FindEntityByName(targetEntity, event.target, caller, activator, caller)) != -1) { byTargetname = true; + attemptCount++; + if(attemptCount > 40) + { + break; + } + SetVariantString(event.variantValue); AcceptEntityInput(targetEntity, event.targetInput, activator, caller, event.outputID);