mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 14:44:17 +00:00
...
This commit is contained in:
parent
a4ffe2e4fd
commit
f3039575a2
1 changed files with 10 additions and 2 deletions
|
@ -5,7 +5,15 @@ using SanAndreasUnity.Net;
|
|||
|
||||
namespace SanAndreasUnity.Behaviours
|
||||
{
|
||||
|
||||
|
||||
public static class PedDamageInfoExtensions
|
||||
{
|
||||
public static Ped GetAttackerPed(this DamageInfo damageInfo)
|
||||
{
|
||||
return damageInfo.attacker as Ped;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Ped {
|
||||
|
||||
public Damageable Damageable { get; private set; }
|
||||
|
@ -128,7 +136,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
public void SendDamagedEventToClients(DamageInfo damageInfo, float damageAmount)
|
||||
{
|
||||
Ped attackingPed = damageInfo.attacker as Ped;
|
||||
Ped attackingPed = damageInfo.GetAttackerPed();
|
||||
|
||||
PedSync.SendDamagedEvent(this.gameObject, attackingPed != null ? attackingPed.gameObject : null, damageAmount);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue