Fix unbuckling from office chairs and being under them (#45337)

* don't set draw depth if direction is the same

* organize?
This commit is contained in:
Jessica M 2026-08-14 00:07:12 +00:00 • committed by GitHub
parent 7ee2ccb7d3
commit c4d9904de5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,9 +44,14 @@ internal sealed partial class BuckleSystem : SharedBuckleSystem
if (!_spriteQuery.TryComp(ent, out SpriteComponent? strapSprite))
return;
var angle = _xformSystem.GetWorldRotation(ent) + _eye.CurrentEye.Rotation; // Get true screen position, or close enough
var newDir = (args.NewRotation + _eye.CurrentEye.Rotation).GetCardinalDir();
var oldDir = (args.OldRotation + _eye.CurrentEye.Rotation).GetCardinalDir();
if (newDir == oldDir)
return;
var isNorth = newDir == Direction.North;
var isNorth = angle.GetCardinalDir() == Direction.North;
foreach (var buckledEntity in ent.Comp.BuckledEntities)
{
if (!TryComp<BuckleComponent>(buckledEntity, out var buckle))