Partial buckling refactor (#29031)

* partial buckling refactor

* git mv test

* change test namespace

* git mv test

* Update test namespace

* Add pulling test

* Network BuckleTime

* Add two more tests

* smelly
This commit is contained in:
Leon Friedrich
2024-06-20 03:14:18 +12:00
committed by GitHub
parent e33f0341ad
commit fa3c89a521
38 changed files with 1053 additions and 890 deletions

View File

@@ -1,11 +1,9 @@
using Content.Server.Buckle.Systems;
using Content.Shared.Buckle.Components;
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Combat;
public sealed partial class UnbuckleOperator : HTNOperator
{
[Dependency] private readonly IEntityManager _entManager = default!;
private BuckleSystem _buckle = default!;
[DataField("shutdownState")]
@@ -21,10 +19,7 @@ public sealed partial class UnbuckleOperator : HTNOperator
{
base.Startup(blackboard);
var owner = blackboard.GetValue<EntityUid>(NPCBlackboard.Owner);
if (!_entManager.TryGetComponent<BuckleComponent>(owner, out var buckle) || !buckle.Buckled)
return;
_buckle.TryUnbuckle(owner, owner, true, buckle);
_buckle.Unbuckle(owner, null);
}
public override HTNOperatorStatus Update(NPCBlackboard blackboard, float frameTime)