Prevent dead players from turning bar stools (#24308)
Prevent dead users from turning their bar stools Previously, players could always turn a bar stool or office chair they were buckled into; even while stone cold dead!
This commit is contained in:
@@ -80,14 +80,8 @@ namespace Content.Shared.Interaction
|
||||
|
||||
public bool TryFaceAngle(EntityUid user, Angle diffAngle, TransformComponent? xform = null)
|
||||
{
|
||||
if (_actionBlockerSystem.CanChangeDirection(user))
|
||||
{
|
||||
if (!Resolve(user, ref xform))
|
||||
return false;
|
||||
|
||||
_transform.SetWorldRotation(xform, diffAngle);
|
||||
return true;
|
||||
}
|
||||
if (!_actionBlockerSystem.CanChangeDirection(user))
|
||||
return false;
|
||||
|
||||
if (EntityManager.TryGetComponent(user, out BuckleComponent? buckle) && buckle.Buckled)
|
||||
{
|
||||
@@ -105,9 +99,16 @@ namespace Content.Shared.Interaction
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
// user is not buckled in; apply to their transform
|
||||
if (!Resolve(user, ref xform))
|
||||
return false;
|
||||
|
||||
_transform.SetWorldRotation(xform, diffAngle);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user