summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-08-11 17:15:31 +0000
committerglx <glx@openttd.org>2008-08-11 17:15:31 +0000
commit16aac30c668be700f1447460422f526bad1c6693 (patch)
tree249233fcb38e652246c309bad228d181cdaa28cd /src/settings.cpp
parentebe9ae2b1755c619953a591c35613e7315954817 (diff)
downloadopenttd-16aac30c668be700f1447460422f526bad1c6693.tar.xz
(svn r14041) -Feature(tte): make it possible to filter list_patches output like it's done for other list_* console commands
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index c648843bf..8f82d7eae 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -2385,11 +2385,14 @@ void IConsoleGetPatchSetting(const char *name)
}
}
-void IConsoleListPatches()
+void IConsoleListPatches(const char *prefilter)
{
IConsolePrintF(CC_WARNING, "All patches with their current value:");
for (const SettingDesc *sd = _patch_settings; sd->save.cmd != SL_END; sd++) {
+ if (prefilter != NULL) {
+ if (strncmp(sd->desc.name, prefilter, min(strlen(sd->desc.name), strlen(prefilter))) != 0) continue;
+ }
char value[80];
const void *ptr = GetVariableAddress((_game_mode == GM_MENU) ? &_settings_newgame : &_settings_game, &sd->save);