summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:50:44 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:50:44 +0000
commit5cda1d7c90f7ac2a1d8a851edbe426f07a032946 (patch)
tree49cf84b2640c39bca5b7dad70f3e19c481f7025f /src/string.cpp
parent577fe0238e7f4681fdf96b8aed241908a9f72de9 (diff)
downloadopenttd-5cda1d7c90f7ac2a1d8a851edbe426f07a032946.tar.xz
(svn r23603) -Add: support for control commands in strings, in both network and safe/load (Rubidium)
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 94377c1b6..78869614a 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -207,7 +207,7 @@ void str_validate(char *str, const char *last, StringValidationSettings settings
* characters to be skipped */
if (c == '\0') break;
- if (IsPrintable(c) && (c < SCC_SPRITE_START || c > SCC_SPRITE_END)) {
+ if ((IsPrintable(c) && (c < SCC_SPRITE_START || c > SCC_SPRITE_END)) || ((settings & SVS_ALLOW_CONTROL_CODE) != 0 && IsInsideMM(c, SCC_CONTROL_START, SCC_CONTROL_END))) {
/* Copy the character back. Even if dst is current the same as str
* (i.e. no characters have been changed) this is quicker than
* moving the pointers ahead by len */