Simulation now (sort of) respects the match-state
This commit is contained in:
@@ -196,9 +196,14 @@ bool game_session_enqueue_player_input(Game_Session *session, uint16_t player_in
|
||||
assert(player != NULL);
|
||||
|
||||
if(simulation_input_equal(player->most_recent_input, input)) {
|
||||
// Ignore 'input' if it's equal to the most recent input. This way we avoid duplicates.
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: SS - Check if 'input' is a valid "snake-move".
|
||||
// Inputting right when going left will sadly be "okay" here which will make the game
|
||||
// feel less responsive.
|
||||
|
||||
if(!squeue_push(&player->input_queue, (void *)&input)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user