Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 9e93916

Browse files
committed
Fix not being able to change facing when using movators in kbd-only
1 parent c927c74 commit 9e93916

File tree

1 file changed

+10
-1
lines changed
  • Data/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Automovers/Controller

1 file changed

+10
-1
lines changed

Data/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Automovers/Controller/Controller.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,15 @@ end
14331433
automoverActorFunctions.updateMovingActor = function(self, actorData, anyCenteringWasDone)
14341434
local actor = actorData.actor;
14351435
local actorDirection = actorData.direction;
1436+
1437+
local actorController = actor:GetController();
1438+
if not actorController:IsMouseControlled() and not actorController:IsGamepadControlled() then
1439+
if actorDirection == Directions.Left and actor.HFlipped == false then
1440+
actor.HFlipped = true;
1441+
elseif actorDirection == Directions.Right and actor.HFlipped == true then
1442+
actor.HFlipped = false;
1443+
end
1444+
end
14361445

14371446
local directionMovementTable = {
14381447
[Directions.Up] = { acceleration = Vector(0, -self.movementAcceleration), aHumanRotAngle = 0, aHumanProneState = AHuman.NOTPRONE, aHumanCrouchState = false },
@@ -1460,7 +1469,7 @@ automoverActorFunctions.updateMovingActor = function(self, actorData, anyCenteri
14601469
verticalRotationAdjustment = direction == Directions.Down and -actor.FlipFactor or 1;
14611470
ToAHuman(actor).ProneState = movementTable.aHumanProneState;
14621471
end
1463-
actor:GetController():SetState(Controller.BODY_CROUCH, movementTable.aHumanCrouchState);
1472+
actorController:SetState(Controller.BODY_CROUCH, movementTable.aHumanCrouchState);
14641473
end
14651474
if actor.RotAngle > rotAngleGoal + self.movementAcceleration then
14661475
actor.RotAngle = actor.RotAngle - (self.movementAcceleration * 0.25 * verticalRotationAdjustment);

0 commit comments

Comments
 (0)