(f27ee6807) Changed to only show damage indication when the section is damaged

This commit is contained in:
Joonas Rikkonen
2019-04-17 12:42:53 +03:00
parent 1615e2f6aa
commit ee2326db63
@@ -326,12 +326,15 @@ namespace Barotrauma
if (SectionCount > 0 && HasBody) if (SectionCount > 0 && HasBody)
{ {
for (int i = 0; i < SectionCount; i++) for (int i = 0; i < SectionCount; i++)
{
if (GetSection(i).damage > 0)
{ {
var textPos = SectionPosition(i, true); var textPos = SectionPosition(i, true);
textPos.Y = -textPos.Y; textPos.Y = -textPos.Y;
GUI.DrawString(spriteBatch, textPos, "Damage: " + (int)((GetSection(i).damage / Health) * 100f) + "%", Color.Yellow); GUI.DrawString(spriteBatch, textPos, "Damage: " + (int)((GetSection(i).damage / Health) * 100f) + "%", Color.Yellow);
} }
} }
}
AiTarget?.Draw(spriteBatch); AiTarget?.Draw(spriteBatch);
} }