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) {
|
void player_process_action(player_t *player, const char *action) {
|
||||||
// Quit on q
|
// Quit on q
|
||||||
|
|
||||||
if (action[0] == 'q') {
|
switch (action[0]) {
|
||||||
exit(0);
|
case 'q':
|
||||||
|
exit(0);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)player;
|
(void)player;
|
||||||
|
|||||||
Reference in New Issue
Block a user