summaryrefslogtreecommitdiff
path: root/src/console_cmds.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:55:56 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:55:56 +0000
commitc99950c21537f9c890e4eac6d077c0ec6f31b7aa (patch)
treec130b8aa9cf12c7c3a1c9ef014bb35df3f53035f /src/console_cmds.cpp
parentb4f832f29f44dcd48e8f0806d47ce78b1963d639 (diff)
downloadopenttd-c99950c21537f9c890e4eac6d077c0ec6f31b7aa.tar.xz
(svn r23606) -Add: GameScanner, to auto-detect game scripts, and wire it in the console
Diffstat (limited to 'src/console_cmds.cpp')
-rw-r--r--src/console_cmds.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 1844c552e..7bc723ec6 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -37,6 +37,7 @@
#include "newgrf.h"
#include "console_func.h"
#include "engine_base.h"
+#include "game/game.hpp"
#ifdef ENABLE_NETWORK
#include "table/strings.h"
@@ -1105,6 +1106,16 @@ DEF_CONSOLE_CMD(ConListAI)
return true;
}
+DEF_CONSOLE_CMD(ConListGame)
+{
+ char buf[4096];
+ Game::GetConsoleList(buf, lastof(buf));
+
+ PrintLineByLine(buf);
+
+ return true;
+}
+
DEF_CONSOLE_CMD(ConStartAI)
{
if (argc == 0 || argc > 3) {
@@ -1895,6 +1906,8 @@ void IConsoleStdLibRegister()
IConsoleCmdRegister("start_ai", ConStartAI);
IConsoleCmdRegister("stop_ai", ConStopAI);
+ IConsoleCmdRegister("list_game", ConListGame);
+
/* networking functions */
#ifdef ENABLE_NETWORK
/* Content downloading is only available with ZLIB */