Use switch
This commit is contained in:
@@ -10,8 +10,11 @@ player_t player_create(uint16_t x, uint16_t y) {
|
||||
void player_process_action(player_t *player, const char *action) {
|
||||
// Quit on q
|
||||
|
||||
if (action[0] == 'q') {
|
||||
exit(0);
|
||||
switch (action[0]) {
|
||||
case 'q':
|
||||
exit(0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
(void)player;
|
||||
|
||||
Reference in New Issue
Block a user