don't display inflicted damage for the same player

This commit is contained in:
in0finite 2021-02-22 23:56:58 +01:00
parent 9e7378d1ca
commit c52fd29de8

View file

@ -135,7 +135,7 @@ namespace SanAndreasUnity.Behaviours
public void OnReceivedDamageEventFromServer(float damageAmount, Ped attackingPed)
{
if (attackingPed != null && attackingPed.IsControlledByLocalPlayer)
if (attackingPed != null && attackingPed.IsControlledByLocalPlayer && attackingPed != this)
{
this.DisplayInflictedDamageMessage(damageAmount);
}
@ -148,7 +148,7 @@ namespace SanAndreasUnity.Behaviours
msg.velocity = Random.insideUnitCircle.normalized * PedManager.Instance.inflictedDamageMessageVelocityInScreenPerc;
msg.TextColor = PedManager.Instance.inflictedDamageMessageColor;
msg.timeLeft = PedManager.Instance.inflictedDamageMessageLifetime;
msg.Text = damageAmount.ToString();
msg.Text = Mathf.RoundToInt(damageAmount).ToString();
}
public void Kill()