fix(simulation): discard movement input while paused

process_player_input processed movement commands regardless of tick
rate, causing the camera to drift from the player when the game was
paused and the player held direction keys. Add PlayerAction::is_movement()
helper and a paused guard that skips movement actions while TickRate is
Paused. Pause/Unpause commands still process normally.

Fixes bug #3 (player moves while game is paused).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 23:25:51 +01:00
co-authored by Claude Opus 4.6
parent d1aba3d554
commit 2b54697278
2 changed files with 22 additions and 0 deletions
+17
View File
@@ -308,6 +308,23 @@ pub enum PlayerAction {
ToggleStanceDown,
}
impl PlayerAction {
/// Returns true for directional movement commands.
pub fn is_movement(&self) -> bool {
matches!(
self,
PlayerAction::MoveNorth
| PlayerAction::MoveSouth
| PlayerAction::MoveEast
| PlayerAction::MoveWest
| PlayerAction::MoveNortheast
| PlayerAction::MoveNorthwest
| PlayerAction::MoveSoutheast
| PlayerAction::MoveSouthwest
)
}
}
/// Available interaction verbs for a nearby entity (D-060, #404)
/// Embedded in ObserverSnapshot.nearby_interactions.
#[derive(Debug, Clone, Serialize, Deserialize)]