mirror of
https://github.com/hermansimensen/eventqueue-fix.git
synced 2025-12-07 02:18:26 +00:00
FindEntityByClassname needs to be used too
no love for csgo in 2025 stop being retarded
This commit is contained in:
parent
e324143b8c
commit
6233e7b01f
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"editor.trimAutoWhitespace": false,
|
||||||
|
"files.trimTrailingWhitespace": false
|
||||||
|
}
|
||||||
@ -318,9 +318,13 @@ public void ServiceEvent(event_t event)
|
|||||||
if(!IsValidEntity(caller))
|
if(!IsValidEntity(caller))
|
||||||
caller = -1;
|
caller = -1;
|
||||||
|
|
||||||
|
bool byTargetname = false;
|
||||||
|
|
||||||
// In the context of the event, the searching entity is also the caller
|
// In the context of the event, the searching entity is also the caller
|
||||||
while ((targetEntity = FindEntityByName(targetEntity, event.target, caller, activator, caller)) != -1)
|
while ((targetEntity = FindEntityByName(targetEntity, event.target, caller, activator, caller)) != -1)
|
||||||
{
|
{
|
||||||
|
byTargetname = true;
|
||||||
|
|
||||||
SetVariantString(event.variantValue);
|
SetVariantString(event.variantValue);
|
||||||
AcceptEntityInput(targetEntity, event.targetInput, activator, caller, event.outputID);
|
AcceptEntityInput(targetEntity, event.targetInput, activator, caller, event.outputID);
|
||||||
|
|
||||||
@ -328,6 +332,20 @@ public void ServiceEvent(event_t event)
|
|||||||
PrintToServer("[%i] Performing output: %s, %i, %i, %s %s, %i, %f", GetGameTickCount(), event.target, targetEntity, caller, event.targetInput, event.variantValue, event.outputID, GetGameTime());
|
PrintToServer("[%i] Performing output: %s, %i, %i, %s %s, %i, %f", GetGameTickCount(), event.target, targetEntity, caller, event.targetInput, event.variantValue, event.outputID, GetGameTime());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!byTargetname)
|
||||||
|
{
|
||||||
|
// In the context of the event, the searching entity is also the caller
|
||||||
|
while ((targetEntity = FindEntityByClassname(targetEntity, event.target)) != -1)
|
||||||
|
{
|
||||||
|
SetVariantString(event.variantValue);
|
||||||
|
AcceptEntityInput(targetEntity, event.targetInput, activator, caller, event.outputID);
|
||||||
|
|
||||||
|
#if defined DEBUG
|
||||||
|
PrintToServer("[%i] Performing output (w/ classname): %s, %i, %i, %s %s, %i, %f", GetGameTickCount(), event.target, targetEntity, caller, event.targetInput, event.variantValue, event.outputID, GetGameTime());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
|
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user