diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/control.c | 3 | ||||
| -rw-r--r-- | src/screen/world.c | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/client/control.c b/src/client/control.c index 8075692..bfc2428 100644 --- a/src/client/control.c +++ b/src/client/control.c @@ -60,12 +60,9 @@ int control_get_key_route(control_t *my_control) int control_get_key_action(control_t *my_control) { Uint8 *map; - SDLKey ret_key; assert(my_control != NULL); - ret_key = CONTROL_NONE; - map = SDL_GetKeyState(NULL); if (map[my_control->key[CONTROL_SHOT]] == SDL_PRESSED) { diff --git a/src/screen/world.c b/src/screen/world.c index b1043a1..3d3214b 100644 --- a/src/screen/world.c +++ b/src/screen/world.c @@ -243,12 +243,16 @@ static void control_keyboard(tux_t *tux, control_t *control) switch (control_get_key_action(control)) { case CONTROL_SHOT: - netAction(tux, TUX_SHOT); - tux_action(tux, TUX_SHOT); + if (tux->isCanShot == TRUE) { + netAction(tux, TUX_SHOT); + tux_action(tux, TUX_SHOT); + } break; case CONTROL_SWITCH: - netAction(tux, TUX_SWITCH_GUN); - tux_action(tux, TUX_SWITCH_GUN); + if (tux->isCanSwitchGun == TRUE) { + netAction(tux, TUX_SWITCH_GUN); + tux_action(tux, TUX_SWITCH_GUN); + } break; } } |