Fix not staying buckled to a strap when both the buckled and the strap go into the same container
This commit is contained in:
34
Content.Server/GameObjects/EntitySystems/BuckleSystem.cs
Normal file
34
Content.Server/GameObjects/EntitySystems/BuckleSystem.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.EntitySystems.Click;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
|
||||
namespace Content.Server.GameObjects.EntitySystems
|
||||
{
|
||||
public class BuckleSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
EntityQuery = new TypeEntityQuery(typeof(BuckleComponent));
|
||||
|
||||
UpdatesAfter.Add(typeof(InteractionSystem));
|
||||
UpdatesAfter.Add(typeof(InputSystem));
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
foreach (var entity in RelevantEntities)
|
||||
{
|
||||
if (!entity.TryGetComponent(out BuckleComponent buckle))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
buckle.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user