From 322c2261b67009d181c9888310294fda5696e48e Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sat, 8 Aug 2020 20:34:28 +1000 Subject: [PATCH] Conveyors now tickrate agnostic (#1618) Co-authored-by: Metal Gear Sloth --- .../GameObjects/Components/Conveyor/ConveyorComponent.cs | 4 ++-- Content.Server/GameObjects/EntitySystems/ConveyorSystem.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs b/Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs index 8faf21556d..13314712cb 100644 --- a/Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs +++ b/Content.Server/GameObjects/Components/Conveyor/ConveyorComponent.cs @@ -136,7 +136,7 @@ namespace Content.Server.GameObjects.Components.Conveyor return true; } - public void Update() + public void Update(float frameTime) { if (!CanRun()) { @@ -156,7 +156,7 @@ namespace Content.Server.GameObjects.Components.Conveyor if (entity.TryGetComponent(out ICollidableComponent collidable)) { var controller = collidable.EnsureController(); - controller.Move(direction, _speed); + controller.Move(direction, _speed * frameTime); } } } diff --git a/Content.Server/GameObjects/EntitySystems/ConveyorSystem.cs b/Content.Server/GameObjects/EntitySystems/ConveyorSystem.cs index 4b8b6facd4..6d75e5bcd8 100644 --- a/Content.Server/GameObjects/EntitySystems/ConveyorSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/ConveyorSystem.cs @@ -27,7 +27,7 @@ namespace Content.Server.GameObjects.EntitySystems continue; } - conveyor.Update(); + conveyor.Update(frameTime); } } }