physics: also block strafe input when movement is rooted

This commit is contained in:
Kelsi 2026-03-10 13:02:35 -07:00
parent 21604461fc
commit dd6f6d1174

View file

@ -287,14 +287,15 @@ void CameraController::update(float deltaTime) {
// WoW-like third-person keyboard behavior: // WoW-like third-person keyboard behavior:
// - RMB held: A/D strafe // - RMB held: A/D strafe
// - RMB released: A/D turn character+camera, Q/E strafe // - RMB released: A/D turn character+camera, Q/E strafe
// Turning is allowed even while rooted; only positional movement is blocked.
if (thirdPerson && !rightMouseDown) { if (thirdPerson && !rightMouseDown) {
nowTurnLeft = keyA; nowTurnLeft = keyA;
nowTurnRight = keyD; nowTurnRight = keyD;
nowStrafeLeft = keyQ; nowStrafeLeft = !movBlocked && keyQ;
nowStrafeRight = keyE; nowStrafeRight = !movBlocked && keyE;
} else { } else {
nowStrafeLeft = keyA || keyQ; nowStrafeLeft = !movBlocked && (keyA || keyQ);
nowStrafeRight = keyD || keyE; nowStrafeRight = !movBlocked && (keyD || keyE);
} }
// Keyboard turning updates camera yaw (character follows yaw in renderer) // Keyboard turning updates camera yaw (character follows yaw in renderer)