mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
...
This commit is contained in:
parent
a4ffe2e4fd
commit
f3039575a2
1 changed files with 10 additions and 2 deletions
|
@ -6,6 +6,14 @@ 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…
Add table
Reference in a new issue