Changed "Run" to "Walk" in code (#1154)

* Changed "Run" to "Walk" in code

Fixes #844

* Revert "Changed "Run" to "Walk" in code"

This reverts commit bf70dc7214d08c208823bccd5d3f36854d6b80de.

* Changed "Run" to "Walk" in code

Fixes #844
This commit is contained in:
Vince
2020-06-19 15:15:25 +02:00
committed by GitHub
parent 1331bda3b0
commit cda8f8b2bc
3 changed files with 8 additions and 8 deletions

View File

@@ -73,9 +73,9 @@ namespace Content.Server.GameObjects.EntitySystems
var moveDownCmdHandler = InputCmdHandler.FromDelegate(
session => HandleDirChange(session, Direction.South, true),
session => HandleDirChange(session, Direction.South, false));
var runCmdHandler = InputCmdHandler.FromDelegate(
session => HandleRunChange(session, false),
session => HandleRunChange(session, true));
var walkCmdHandler = InputCmdHandler.FromDelegate(
session => HandleRunChange(session, true),
session => HandleRunChange(session, false));
var input = EntitySystemManager.GetEntitySystem<InputSystem>();
@@ -84,7 +84,7 @@ namespace Content.Server.GameObjects.EntitySystems
.Bind(EngineKeyFunctions.MoveLeft, moveLeftCmdHandler)
.Bind(EngineKeyFunctions.MoveRight, moveRightCmdHandler)
.Bind(EngineKeyFunctions.MoveDown, moveDownCmdHandler)
.Bind(EngineKeyFunctions.Run, runCmdHandler)
.Bind(EngineKeyFunctions.Walk, walkCmdHandler)
.Register<MoverSystem>();
SubscribeLocalEvent<PlayerAttachSystemMessage>(PlayerAttached);
@@ -265,12 +265,12 @@ namespace Content.Server.GameObjects.EntitySystems
moverComp.SetVelocityDirection(dir, state);
}
private static void HandleRunChange(ICommonSession session, bool running)
private static void HandleRunChange(ICommonSession session, bool walking)
{
if (!TryGetAttachedComponent(session as IPlayerSession, out PlayerInputMoverComponent moverComp))
return;
moverComp.Sprinting = running;
moverComp.Sprinting = !walking;
}
private static bool TryGetAttachedComponent<T>(IPlayerSession session, out T component)