From 01d613a7ccf695090262c9e22c396251146f00bd Mon Sep 17 00:00:00 2001 From: oroborus Date: Wed, 19 Mar 2008 19:32:50 +0000 Subject: - upravy v kode git-svn-id: http://opensvn.csie.org/tuxanci_ng@27 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/screen_world.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/screen_world.c') diff --git a/src/screen_world.c b/src/screen_world.c index 45daee5..60260b9 100644 --- a/src/screen_world.c +++ b/src/screen_world.c @@ -241,7 +241,7 @@ static void netAction(tux_t *tux, int action) { if( getSettingGameType() == NET_GAME_TYPE_SERVER ) { - proto_send_event_server(tux , action, NULL); + proto_send_event_server(PROTO_SEND_ALL, NULL, tux , action); } if( getSettingGameType() == NET_GAME_TYPE_CLIENT ) @@ -290,8 +290,11 @@ static void control_keyboard_right(tux_t *tux) if( mapa[(SDLKey)SDLK_KP1] == SDL_PRESSED ) { - netAction(tux, TUX_SWITCH_GUN); - actionTux(tux, TUX_SWITCH_GUN); + if( tux->isCanSwitchGun == TRUE ) + { + netAction(tux, TUX_SWITCH_GUN); + actionTux(tux, TUX_SWITCH_GUN); + } } } @@ -308,7 +311,15 @@ static void control_keyboard_left(tux_t *tux) if( mapa[(SDLKey)SDLK_a] == SDL_PRESSED )actionTux(tux, TUX_LEFT); if( mapa[(SDLKey)SDLK_s] == SDL_PRESSED )actionTux(tux, TUX_DOWN); if( mapa[(SDLKey)SDLK_q] == SDL_PRESSED )actionTux(tux, TUX_SHOT); - if( mapa[(SDLKey)SDLK_TAB] == SDL_PRESSED )actionTux(tux, TUX_SWITCH_GUN); + + if( mapa[(SDLKey)SDLK_TAB] == SDL_PRESSED ) + { + if( tux->isCanSwitchGun == TRUE ) + { + netAction(tux, TUX_SWITCH_GUN); + actionTux(tux, TUX_SWITCH_GUN); + } + } } static void eventEsc() -- cgit v1.2.3