2021-08-10 10:34:01 +10:00
|
|
|
using Content.Shared.Movement;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Climbing
|
|
|
|
|
{
|
|
|
|
|
public abstract class SharedClimbSystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
2022-04-10 16:48:11 +12:00
|
|
|
SubscribeLocalEvent<SharedClimbingComponent, UpdateCanMoveEvent>(HandleMoveAttempt);
|
2021-08-10 10:34:01 +10:00
|
|
|
}
|
|
|
|
|
|
2022-04-10 16:48:11 +12:00
|
|
|
private void HandleMoveAttempt(EntityUid uid, SharedClimbingComponent component, UpdateCanMoveEvent args)
|
2021-08-10 10:34:01 +10:00
|
|
|
{
|
2022-04-10 16:48:11 +12:00
|
|
|
if (component.LifeStage > ComponentLifeStage.Running)
|
|
|
|
|
return;
|
|
|
|
|
|
2021-08-10 10:34:01 +10:00
|
|
|
if (component.OwnerIsTransitioning)
|
|
|
|
|
args.Cancel();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|