mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
use "world client" when recieving fall damage/damage
fix rare bug with GetClientByName refactor some alias/ef stuff. still more to do
This commit is contained in:
@ -86,12 +86,34 @@ namespace IW4MAdmin.Plugins.Stats
|
||||
case GameEvent.EventType.Kill:
|
||||
if (!E.Owner.CustomCallback)
|
||||
{
|
||||
// this treats "world" damage as self damage
|
||||
if (E.Origin.ClientId == 1)
|
||||
{
|
||||
E.Origin = E.Target;
|
||||
}
|
||||
|
||||
if (E.Target.ClientId == 1)
|
||||
{
|
||||
E.Target = E.Origin;
|
||||
}
|
||||
|
||||
await Manager.AddStandardKill(E.Origin, E.Target);
|
||||
}
|
||||
break;
|
||||
case GameEvent.EventType.Damage:
|
||||
if (!E.Owner.CustomCallback)
|
||||
{
|
||||
// this treats "world" damage as self damage
|
||||
if (E.Origin.ClientId == 1)
|
||||
{
|
||||
E.Origin = E.Target;
|
||||
}
|
||||
|
||||
if (E.Target.ClientId == 1)
|
||||
{
|
||||
E.Target = E.Origin;
|
||||
}
|
||||
|
||||
Manager.AddDamageEvent(E.Data, E.Origin.ClientId, E.Target.ClientId, await StatManager.GetIdForServer(E.Owner));
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user