Fix rotated chair draw depth (#12272)
This commit is contained in:
@@ -46,7 +46,12 @@ namespace Content.Client.Buckle
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adjust draw depth when the chair faces north so that the seat back is drawn over the player.
|
||||||
|
// Reset the draw depth when rotated in any other direction.
|
||||||
// TODO when ECSing, make this a visualizer
|
// TODO when ECSing, make this a visualizer
|
||||||
|
// This code was written before rotatable viewports were introduced, so hard-coding Direction.North
|
||||||
|
// and comparing it against LocalRotation now breaks this in other rotations. This is a FIXME, but
|
||||||
|
// better to get it working for most people before we look at a more permanent solution.
|
||||||
if (_buckled &&
|
if (_buckled &&
|
||||||
LastEntityBuckledTo != null &&
|
LastEntityBuckledTo != null &&
|
||||||
EntMan.GetComponent<TransformComponent>(LastEntityBuckledTo.Value).LocalRotation.GetCardinalDir() == Direction.North &&
|
EntMan.GetComponent<TransformComponent>(LastEntityBuckledTo.Value).LocalRotation.GetCardinalDir() == Direction.North &&
|
||||||
@@ -57,7 +62,8 @@ namespace Content.Client.Buckle
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_originalDrawDepth.HasValue && !_buckled)
|
// If here, we're not turning north and should restore the saved draw depth.
|
||||||
|
if (_originalDrawDepth.HasValue)
|
||||||
{
|
{
|
||||||
ownerSprite.DrawDepth = _originalDrawDepth.Value;
|
ownerSprite.DrawDepth = _originalDrawDepth.Value;
|
||||||
_originalDrawDepth = null;
|
_originalDrawDepth = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user