DamageableSystem cleanup & performance improvements (#20820)
This commit is contained in:
@@ -62,7 +62,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
|
||||
|
||||
var damageSpec = GetDamage(uid, args.User, component);
|
||||
|
||||
if (damageSpec.Total == FixedPoint2.Zero)
|
||||
if (damageSpec.Empty)
|
||||
return;
|
||||
|
||||
_damageExamine.AddDamageExamine(args.Message, damageSpec, Loc.GetString("damage-melee"));
|
||||
|
||||
@@ -85,7 +85,7 @@ public sealed partial class GunSystem
|
||||
{
|
||||
var p = (ProjectileComponent) projectile.Component;
|
||||
|
||||
if (p.Damage.Total > FixedPoint2.Zero)
|
||||
if (!p.Damage.Empty)
|
||||
{
|
||||
return p.Damage;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public sealed partial class GunSystem
|
||||
{
|
||||
var p = (ProjectileComponent) projectile.Component;
|
||||
|
||||
if (p.Damage.Total > FixedPoint2.Zero)
|
||||
if (!p.Damage.Empty)
|
||||
{
|
||||
return p.Damage;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ public sealed partial class GunSystem : SharedGunSystem
|
||||
{
|
||||
if (!Deleted(hitEntity))
|
||||
{
|
||||
if (dmg.Total > FixedPoint2.Zero)
|
||||
if (dmg.Any())
|
||||
{
|
||||
_color.RaiseEffect(Color.Red, new List<EntityUid>() { hitEntity }, Filter.Pvs(hitEntity, entityManager: EntityManager));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user