diff options
author | rubidium <rubidium@openttd.org> | 2009-10-31 14:06:16 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-10-31 14:06:16 +0000 |
commit | a5d005dd53822b7ec3294d87d8a5255212b9ecb0 (patch) | |
tree | 8e3b6ccc8bcd9ae8a2282122d24ce68b063e6115 /src/string.cpp | |
parent | 70ebe13ee8ef20ff0e5ae6dd917a7c6fe680f09b (diff) | |
download | openttd-a5d005dd53822b7ec3294d87d8a5255212b9ecb0.tar.xz |
(svn r17920) -Codechange: add a 'filter' for numbers+spaces and use it for the NewGRF parameter list
Diffstat (limited to 'src/string.cpp')
-rw-r--r-- | src/string.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/string.cpp b/src/string.cpp index 6503f8fd1..d9e27857d 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -194,9 +194,10 @@ void strtolower(char *str) bool IsValidChar(WChar key, CharSetFilter afilter) { switch (afilter) { - case CS_ALPHANUMERAL: return IsPrintable(key); - case CS_NUMERAL: return (key >= '0' && key <= '9'); - case CS_ALPHA: return IsPrintable(key) && !(key >= '0' && key <= '9'); + case CS_ALPHANUMERAL: return IsPrintable(key); + case CS_NUMERAL: return (key >= '0' && key <= '9'); + case CS_NUMERAL_SPACE: return (key >= '0' && key <= '9') || key == ' '; + case CS_ALPHA: return IsPrintable(key) && !(key >= '0' && key <= '9'); } return false; |