Add console command to check caches.
This commit is contained in:
@@ -1952,6 +1952,26 @@ DEF_CONSOLE_CMD(ConDumpCommandLog)
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConCheckCaches)
|
||||
{
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("Debug: Check caches");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argc > 2) return false;
|
||||
|
||||
bool broadcast = (argc == 2 && atoi(argv[1]) > 0 && (!_networking || _network_server));
|
||||
if (broadcast) {
|
||||
DoCommandP(0, 0, 0, CMD_DESYNC_CHECK);
|
||||
} else {
|
||||
extern void CheckCaches(bool force_check);
|
||||
CheckCaches(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
/******************
|
||||
* debug commands
|
||||
@@ -2097,6 +2117,7 @@ void IConsoleStdLibRegister()
|
||||
IConsoleDebugLibRegister();
|
||||
#endif
|
||||
IConsoleCmdRegister("dump_command_log", ConDumpCommandLog, nullptr, true);
|
||||
IConsoleCmdRegister("check_caches", ConCheckCaches, nullptr, true);
|
||||
|
||||
/* NewGRF development stuff */
|
||||
IConsoleCmdRegister("reload_newgrfs", ConNewGRFReload, ConHookNewGRFDeveloperTool);
|
||||
|
Reference in New Issue
Block a user