Doors with no broken sprite turn black when destroyed (just like before). TODO: graphics for broken ruin doors/hatches

This commit is contained in:
Joonas Rikkonen
2017-12-05 22:31:13 +02:00
parent 0b603ba10b
commit 2e6d35ce8e
@@ -83,10 +83,16 @@ namespace Barotrauma.Items.Components
convexHull.SetVertices(GetConvexHullCorners(rect)); convexHull.SetVertices(GetConvexHullCorners(rect));
} }
} }
public void Draw(SpriteBatch spriteBatch, bool editing) public void Draw(SpriteBatch spriteBatch, bool editing)
{ {
Color color = (item.IsSelected) ? Color.Green : Color.White; Color color = (item.IsSelected) ? Color.Green : Color.White;
if (brokenSprite == null)
{
//broken doors turn black if no broken sprite has been configured
color = color * (item.Condition / item.Prefab.Health);
color.A = 255;
}
if (stuck > 0.0f && weldedSprite != null) if (stuck > 0.0f && weldedSprite != null)
{ {