diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-12-16 09:53:57 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-12-16 09:53:57 +0000 |
| commit | d9ad96384b85d13c1b72c165d25457bedbfcc021 (patch) | |
| tree | 3d6b0b40d298c2da92bc31aaf7597da589cfbae0 /src/game | |
| parent | 27a24b361b0387de790165cc14ad2a37fceb9ece (diff) | |
| download | zcatch-d9ad96384b85d13c1b72c165d25457bedbfcc021.tar.gz zcatch-d9ad96384b85d13c1b72c165d25457bedbfcc021.zip | |
fixed so that the join red and join blue buttons isn't displayed in dm
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/client/gc_client.cpp | 6 | ||||
| -rw-r--r-- | src/game/client/gc_menu.cpp | 41 |
2 files changed, 25 insertions, 22 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp index 95f322a1..159c2067 100644 --- a/src/game/client/gc_client.cpp +++ b/src/game/client/gc_client.cpp @@ -30,8 +30,6 @@ enum data_container *data = 0x0; -int gametype = GAMETYPE_DM; - extern void modmenu_render(); enum @@ -61,7 +59,7 @@ static const obj_player_character *local_character = 0; static const obj_player_character *local_prev_character = 0; const obj_player_info *local_info = 0; static const obj_flag *flags[2] = {0,0}; -static const obj_game *gameobj = 0; +const obj_game *gameobj = 0; static int picked_up_weapon = 0; @@ -2739,7 +2737,7 @@ void render_game() // render goals if(gameobj) { - gametype = gameobj->gametype; + int gametype = gameobj->gametype; float whole = 300*gfx_screenaspect(); float half = whole/2.0f; diff --git a/src/game/client/gc_menu.cpp b/src/game/client/gc_menu.cpp index 1a3c9d50..e25342dd 100644 --- a/src/game/client/gc_menu.cpp +++ b/src/game/client/gc_menu.cpp @@ -30,6 +30,8 @@ extern data_container *data; // abit uglyness extern const obj_player_info *local_info; +extern const obj_game *gameobj; + extern bool menu_active; extern bool menu_game_active; @@ -1622,7 +1624,7 @@ static void menu2_render_game(RECT main_view) if(ui2_do_button(&disconnect_button, "Disconnect", 0, &button, ui2_draw_menu_button, 0)) client_disconnect(); - if(local_info) + if(local_info && gameobj) { if(local_info->team != -1) { @@ -1635,28 +1637,31 @@ static void menu2_render_game(RECT main_view) menu_active = false; } } - - if(local_info->team != 0) + + if(gameobj->gametype != GAMETYPE_DM) { - ui2_vsplit_l(&main_view, 10.0f, &button, &main_view); - ui2_vsplit_l(&main_view, 120.0f, &button, &main_view); - static int spectate_button = 0; - if(ui2_do_button(&spectate_button, "Join Red", 0, &button, ui2_draw_menu_button, 0)) + if(local_info->team != 0) { - config.cl_team = 0; - menu_active = false; + ui2_vsplit_l(&main_view, 10.0f, &button, &main_view); + ui2_vsplit_l(&main_view, 120.0f, &button, &main_view); + static int spectate_button = 0; + if(ui2_do_button(&spectate_button, "Join Red", 0, &button, ui2_draw_menu_button, 0)) + { + config.cl_team = 0; + menu_active = false; + } } - } - if(local_info->team != 1) - { - ui2_vsplit_l(&main_view, 10.0f, &button, &main_view); - ui2_vsplit_l(&main_view, 120.0f, &button, &main_view); - static int spectate_button = 0; - if(ui2_do_button(&spectate_button, "Join Blue", 0, &button, ui2_draw_menu_button, 0)) + if(local_info->team != 1) { - config.cl_team = 1; - menu_active = false; + ui2_vsplit_l(&main_view, 10.0f, &button, &main_view); + ui2_vsplit_l(&main_view, 120.0f, &button, &main_view); + static int spectate_button = 0; + if(ui2_do_button(&spectate_button, "Join Blue", 0, &button, ui2_draw_menu_button, 0)) + { + config.cl_team = 1; + menu_active = false; + } } } } |