Disable climbing when buckled (#2488)
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
using Content.Shared.GameObjects.Components.Movement;
|
#nullable enable
|
||||||
|
using Content.Shared.GameObjects.Components.Buckle;
|
||||||
|
using Content.Shared.GameObjects.Components.Movement;
|
||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Movement
|
namespace Content.Server.GameObjects.Components.Movement
|
||||||
@@ -8,8 +11,8 @@ namespace Content.Server.GameObjects.Components.Movement
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class ClimbingComponent : SharedClimbingComponent
|
public class ClimbingComponent : SharedClimbingComponent
|
||||||
{
|
{
|
||||||
private bool _isClimbing = false;
|
private bool _isClimbing;
|
||||||
private ClimbController _climbController = default;
|
private ClimbController? _climbController;
|
||||||
|
|
||||||
public override bool IsClimbing
|
public override bool IsClimbing
|
||||||
{
|
{
|
||||||
@@ -29,6 +32,19 @@ namespace Content.Server.GameObjects.Components.Movement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
||||||
|
{
|
||||||
|
base.HandleMessage(message, component);
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case BuckleMessage msg:
|
||||||
|
if (msg.Buckled)
|
||||||
|
IsClimbing = false;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make the owner climb from one point to another
|
/// Make the owner climb from one point to another
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user