Make instruments prediction-safe.
This commit is contained in:
@@ -1,11 +1,17 @@
|
|||||||
using Content.Client.GameObjects.Components.Instruments;
|
using Content.Client.GameObjects.Components.Instruments;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
|
using Robust.Shared.Interfaces.Timing;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
|
||||||
namespace Content.Client.GameObjects.EntitySystems
|
namespace Content.Client.GameObjects.EntitySystems
|
||||||
{
|
{
|
||||||
|
[UsedImplicitly]
|
||||||
public class InstrumentSystem : EntitySystem
|
public class InstrumentSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IGameTiming _gameTiming;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -16,6 +22,11 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
base.Update(frameTime);
|
base.Update(frameTime);
|
||||||
|
|
||||||
|
if (!_gameTiming.IsFirstTimePredicted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var entity in RelevantEntities)
|
foreach (var entity in RelevantEntities)
|
||||||
{
|
{
|
||||||
entity.GetComponent<InstrumentComponent>().Update(frameTime);
|
entity.GetComponent<InstrumentComponent>().Update(frameTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user