Have medical scanners and cloning pods be 'climbed upon' on exit. (#5408)
This commit is contained in:
@@ -27,6 +27,14 @@ namespace Content.Server.Climbing
|
||||
SubscribeLocalEvent<ClimbableComponent, GetAlternativeVerbsEvent>(AddClimbVerb);
|
||||
}
|
||||
|
||||
public void ForciblySetClimbing(EntityUid uid, ClimbingComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, false))
|
||||
return;
|
||||
component.IsClimbing = true;
|
||||
UnsetTransitionBoolAfterBufferTime(uid, component);
|
||||
}
|
||||
|
||||
private void AddClimbVerb(EntityUid uid, ClimbableComponent component, GetAlternativeVerbsEvent args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract || !_actionBlockerSystem.CanMove(args.User.Uid))
|
||||
@@ -55,6 +63,17 @@ namespace Content.Server.Climbing
|
||||
_activeClimbers.Remove(climbingComponent);
|
||||
}
|
||||
|
||||
public void UnsetTransitionBoolAfterBufferTime(EntityUid uid, ClimbingComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, false))
|
||||
return;
|
||||
component.Owner.SpawnTimer((int) (SharedClimbingComponent.BufferTime * 1000), () =>
|
||||
{
|
||||
if (component.Deleted) return;
|
||||
component.OwnerIsTransitioning = false;
|
||||
});
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
foreach (var climber in _activeClimbers.ToArray())
|
||||
|
||||
Reference in New Issue
Block a user