summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-10-31 14:06:16 +0000
committerrubidium <rubidium@openttd.org>2009-10-31 14:06:16 +0000
commita5d005dd53822b7ec3294d87d8a5255212b9ecb0 (patch)
tree8e3b6ccc8bcd9ae8a2282122d24ce68b063e6115 /src/string.cpp
parent70ebe13ee8ef20ff0e5ae6dd917a7c6fe680f09b (diff)
downloadopenttd-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.cpp7
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;