Optimization!

This commit is contained in:
Preston Smith
2024-11-10 00:45:54 -06:00
parent 03843734e4
commit 2801ebea8d

View File

@@ -61,15 +61,12 @@ public sealed class DamageExamineSystem : EntitySystem
}
else
{
if (damageSpecifier.DamageDict.Count == 1)
{
// May be simplified to using a foreach(Var x) despite being only one item
if(damageSpecifier.DamageDict.Values.GetEnumerator().Current == FixedPoint2.Zero)
if (damageSpecifier.GetTotal() == FixedPoint2.Zero && !damageSpecifier.AnyPositive())
{
msg.AddMarkupOrThrow(Loc.GetString("damage-none"));
return msg;
}
}
msg.AddMarkupOrThrow(Loc.GetString("damage-examine-type", ("type", type)));
}