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:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user