summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-21 20:12:48 +0000
committerrubidium <rubidium@openttd.org>2010-10-21 20:12:48 +0000
commit87edf2524d8904189391b427a9c823cb3d5fdf03 (patch)
tree5ec3718ba52a2dc2faff4c629269563996f348da /src/network
parenta671f64896251875f8b881db69ce1cc9cb358f5c (diff)
downloadopenttd-87edf2524d8904189391b427a9c823cb3d5fdf03.tar.xz
(svn r21004) -Fix [FS#3746]: chat/console messages got sometimes messed up due to LTR names in RTL translations and vice-versa
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 68d3887f2..7d3dbbe13 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -202,7 +202,13 @@ void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_se
SetDParamStr(0, name);
SetDParamStr(1, str);
SetDParam(2, data);
- GetString(message, strid, lastof(message));
+
+ /* All of these strings start with "***". These characters are interpreted as both left-to-right and
+ * right-to-left characters depending on the context. As the next text might be an user's name, the
+ * user name's characters will influence the direction of the "***" instead of the language setting
+ * of the game. Manually set the direction of the "***" by inserting a text-direction marker. */
+ char *msg_ptr = message + Utf8Encode(message, _dynlang.text_dir == TD_LTR ? CHAR_TD_LRM : CHAR_TD_RLM);
+ GetString(msg_ptr, strid, lastof(message));
DEBUG(desync, 1, "msg: %08x; %02x; %s", _date, _date_fract, message);
IConsolePrintF(colour, "%s", message);