Option to make wearable sprites use the depth of the sprite instead of using the depth of the limb it's attached to

This commit is contained in:
Joonas Rikkonen
2017-08-10 18:19:06 +03:00
parent b70f6fb3ca
commit fd844fd696
2 changed files with 21 additions and 15 deletions
@@ -88,15 +88,19 @@ namespace Barotrauma
Vector2 origin = wearable.Sprite.Origin;
if (body.Dir == -1.0f) origin.X = wearable.Sprite.SourceRect.Width - origin.X;
float depth = wearable.Sprite.Depth;
float depth = sprite.Depth - 0.000001f;
if (wearable.DepthLimb != LimbType.None)
if (wearable.InheritLimbDepth)
{
Limb depthLimb = character.AnimController.GetLimb(wearable.DepthLimb);
if (depthLimb != null)
depth = sprite.Depth - 0.000001f;
if (wearable.DepthLimb != LimbType.None)
{
depth = depthLimb.sprite.Depth - 0.000001f;
Limb depthLimb = character.AnimController.GetLimb(wearable.DepthLimb);
if (depthLimb != null)
{
depth = depthLimb.sprite.Depth - 0.000001f;
}
}
}