Mercurial > hg > openttd
changeset 18799:270c78416600 draft
(svn r23647) -Add: add rescan_game as console command (patch by Xaroth)
author | truebrain <truebrain@openttd.org> |
---|---|
date | Wed, 21 Dec 2011 12:25:17 +0000 |
parents | 38b1e0421e48 |
children | 3db6a96d4169 |
files | src/console_cmds.cpp |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1274,6 +1274,23 @@ 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 @@ IConsoleCmdRegister("list_game", ConListGame); IConsoleCmdRegister("list_game_libs", ConListGameLibs); + IConsoleCmdRegister("rescan_game", ConRescanGame); /* networking functions */ #ifdef ENABLE_NETWORK