summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-16 17:44:04 +0000
committerDarkvater <darkvater@openttd.org>2006-11-16 17:44:04 +0000
commitea0018fcedd9b2d0da24cbb702330f7349796e8b (patch)
treefead1dbd09600e2f400da8a30f022b454b20aded /main_gui.c
parentedcbb105656514e6b422d2d5e04f6dcb2e30459b (diff)
downloadopenttd-ea0018fcedd9b2d0da24cbb702330f7349796e8b.tar.xz
(svn r7173) -Codechange (r6824): Allow the user to change the chat-destination when chatting with <ENTER> or 'T' instead of the game choosing one for you automatically.
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/main_gui.c b/main_gui.c
index ebcd4d03b..96d91cd5e 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -2298,23 +2298,10 @@ static void MainWindowWndProc(Window *w, WindowEvent *e)
break;
#ifdef ENABLE_NETWORK
- case WKC_RETURN: case 'T': // smart chat; send to team if any, otherwise to all
+ case WKC_RETURN: case 'T': // send to all players or to your team depending on setting
if (_networking) {
- const NetworkClientInfo *cio = NetworkFindClientInfoFromIndex(_network_own_client_index);
- bool has_team = false;
-
- /* Only players actually playing can speak to team. Eg spectators cannot */
- if (IsValidPlayer(cio->client_playas)) {
- const NetworkClientInfo *ci;
- FOR_ALL_ACTIVE_CLIENT_INFOS(ci) {
- if (ci->client_playas == cio->client_playas && ci != cio) {
- has_team = true;
- break;
- }
- }
- }
-
- ShowNetworkChatQueryWindow(has_team ? DESTTYPE_TEAM : DESTTYPE_BROADCAST, cio->client_playas);
+ const NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
+ ShowNetworkChatQueryWindow(_patches.chat_target ? DESTTYPE_TEAM : DESTTYPE_BROADCAST, ci->client_playas);
break;
}
break;