summaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/state.rs b/src/state.rs
index ecbd408..99239ae 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -38,6 +38,10 @@ pub struct Position {
impl GameState {
pub fn update(&mut self, commands: [Command; 2]) {
+ if self.status != GameStatus::Continue {
+ return;
+ }
+
self.do_command(0, &commands[0]);
self.do_command(1, &commands[1]);
self.update_player_collisions();
@@ -64,7 +68,6 @@ impl GameState {
use Command::*;
self.players[player_index].tick_boost();
- // TODO: Command validation assertions
match command {
Nothing => {}
Accelerate => self.players[player_index].accelerate(),