From 5b7cd460e9b75838de5732a56a01ad6311356cb3 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 22 Dec 2008 21:15:02 +0000 Subject: (svn r14715) -Codechange: move some network code from the main gui file into one of the the network files. --- src/main_gui.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/main_gui.cpp') diff --git a/src/main_gui.cpp b/src/main_gui.cpp index ffa2b7feb..1befb36e7 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -317,22 +317,9 @@ struct MainWindow : Window case WKC_RETURN: case 'T': // smart chat; send to team if any, otherwise to all if (_networking) { const NetworkClientInfo *cio = NetworkFindClientInfoFromIndex(_network_own_client_id); - bool teamchat = false; - if (cio == NULL) break; - /* Only companies actually playing can speak to team. Eg spectators cannot */ - if (_settings_client.gui.prefer_teamchat && IsValidCompanyID(cio->client_playas)) { - const NetworkClientInfo *ci; - FOR_ALL_ACTIVE_CLIENT_INFOS(ci) { - if (ci->client_playas == cio->client_playas && ci != cio) { - teamchat = true; - break; - } - } - } - - ShowNetworkChatQueryWindow(teamchat ? DESTTYPE_TEAM : DESTTYPE_BROADCAST, cio->client_playas); + ShowNetworkChatQueryWindow(NetworkClientPreferTeamChat(cio) ? DESTTYPE_TEAM : DESTTYPE_BROADCAST, cio->client_playas); } break; -- cgit v1.2.3-54-g00ecf