From 65d1681cb3fb7a67bbb5e8615487fc667397fedf Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Wed, 25 Mar 2020 22:21:29 +0100 Subject: [PATCH] Fix error about game.diagonalmovement being registered multiple times. --- .../Components/Movement/PlayerInputMoverComponent.cs | 6 ------ Content.Server/GameObjects/EntitySystems/MoverSystem.cs | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs b/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs index 26d056ac17..969b071bd8 100644 --- a/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/PlayerInputMoverComponent.cs @@ -104,12 +104,6 @@ namespace Content.Server.GameObjects.Components.Movement /// [ViewVariables] public bool DiagonalMovementEnabled => _configurationManager.GetCVar("game.diagonalmovement"); - public override void Initialize() - { - base.Initialize(); - _configurationManager.RegisterCVar("game.diagonalmovement", true, CVar.ARCHIVE); - } - /// public override void OnAdd() { diff --git a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs index a2524b6204..5860ac4e35 100644 --- a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs @@ -11,10 +11,12 @@ using Robust.Server.GameObjects; using Robust.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.Player; using Robust.Server.Interfaces.Timing; +using Robust.Shared.Configuration; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components.Transform; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Input; +using Robust.Shared.Interfaces.Configuration; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.Interfaces.Map; @@ -38,6 +40,7 @@ namespace Content.Server.GameObjects.EntitySystems [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager; [Dependency] private readonly IMapManager _mapManager; [Dependency] private readonly IRobustRandom _robustRandom; + [Dependency] private readonly IConfigurationManager _configurationManager; #pragma warning restore 649 private AudioSystem _audioSystem; @@ -78,6 +81,8 @@ namespace Content.Server.GameObjects.EntitySystems SubscribeLocalEvent(PlayerDetached); _audioSystem = EntitySystemManager.GetEntitySystem(); + + _configurationManager.RegisterCVar("game.diagonalmovement", true, CVar.ARCHIVE); } private static void PlayerAttached(PlayerAttachSystemMessage ev)