diff options
author | truebrain <truebrain@openttd.org> | 2011-12-21 12:25:17 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-21 12:25:17 +0000 |
commit | 726ce254ff204346125dce7daed0701dc5c8f724 (patch) | |
tree | 1539dabcb3be6ecf6f147811d30b9a662644e1db | |
parent | da8777d4e590f2c4414453d88c306c57f964326d (diff) | |
download | openttd-726ce254ff204346125dce7daed0701dc5c8f724.tar.xz |
(svn r23647) -Add: add rescan_game as console command (patch by Xaroth)
-rw-r--r-- | src/console_cmds.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 030d03154..374e378f7 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1274,6 +1274,23 @@ DEF_CONSOLE_CMD(ConRescanAI) return true; } +DEF_CONSOLE_CMD(ConRescanGame) +{ + if (argc == 0) { + IConsoleHelp("Rescan the Game Script dir for scripts. Usage: 'rescan_game'"); + return true; + } + + if (_networking && !_network_server) { + IConsoleWarning("Only the server can rescan the Game Script dir for scripts."); + return true; + } + + Game::Rescan(); + + return true; +} + DEF_CONSOLE_CMD(ConRescanNewGRF) { if (argc == 0) { @@ -1918,6 +1935,7 @@ void IConsoleStdLibRegister() IConsoleCmdRegister("list_game", ConListGame); IConsoleCmdRegister("list_game_libs", ConListGameLibs); + IConsoleCmdRegister("rescan_game", ConRescanGame); /* networking functions */ #ifdef ENABLE_NETWORK |