From f392a78c76f3756aea765f708eeaa6b33ed4ddfc Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 29 May 2020 22:50:41 +0200 Subject: [PATCH] Make instruments prediction-safe. --- .../GameObjects/EntitySystems/InstrumentSystem.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Content.Client/GameObjects/EntitySystems/InstrumentSystem.cs b/Content.Client/GameObjects/EntitySystems/InstrumentSystem.cs index 6303475c30..887f84a069 100644 --- a/Content.Client/GameObjects/EntitySystems/InstrumentSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/InstrumentSystem.cs @@ -1,11 +1,17 @@ using Content.Client.GameObjects.Components.Instruments; +using JetBrains.Annotations; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Systems; +using Robust.Shared.Interfaces.Timing; +using Robust.Shared.IoC; namespace Content.Client.GameObjects.EntitySystems { + [UsedImplicitly] public class InstrumentSystem : EntitySystem { + [Dependency] private readonly IGameTiming _gameTiming; + public override void Initialize() { base.Initialize(); @@ -16,6 +22,11 @@ namespace Content.Client.GameObjects.EntitySystems { base.Update(frameTime); + if (!_gameTiming.IsFirstTimePredicted) + { + return; + } + foreach (var entity in RelevantEntities) { entity.GetComponent().Update(frameTime);