diff options
author | rubidium <rubidium@openttd.org> | 2008-07-14 17:31:41 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-07-14 17:31:41 +0000 |
commit | b7c69ba5f05dbadd3ad76d182e54d7e78cc958a2 (patch) | |
tree | 78d78f40495e1abe06d5d07af38b06318f8a0531 /src | |
parent | 1c17405721e82ecad5b02d7ac6ae69292bffff7a (diff) | |
download | openttd-b7c69ba5f05dbadd3ad76d182e54d7e78cc958a2.tar.xz |
(svn r13699) -Fix: handle SETX(Y) properly when truncating a string instead of ignoring it and returning a too long string.
Diffstat (limited to 'src')
-rw-r--r-- | src/gfx.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 2fca52bfe..491112431 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -262,9 +262,13 @@ static int TruncateString(char *str, int maxw) return ddd_w; } } else { - if (c == SCC_SETX) str++; - else if (c == SCC_SETXY) str += 2; - else if (c == SCC_TINYFONT) { + if (c == SCC_SETX) { + w = *str; + str++; + } else if (c == SCC_SETXY) { + w = *str; + str += 2; + } else if (c == SCC_TINYFONT) { size = FS_SMALL; ddd = GetCharacterWidth(size, '.') * 3; } else if (c == SCC_BIGFONT) { |