diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index e22fb5da26..c6cca74fb6 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -2010,6 +2010,19 @@ DEF_CONSOLE_CMD(ConCheckCaches) return true; } +DEF_CONSOLE_CMD(ConDoDisaster) +{ + if (argc == 0) { + IConsoleHelp("Debug: Do disaster"); + return true; + } + + extern void DoDisaster(); + DoDisaster(); + + return true; +} + #ifdef _DEBUG /****************** * debug commands @@ -2161,6 +2174,7 @@ void IConsoleStdLibRegister() /* NewGRF development stuff */ IConsoleCmdRegister("reload_newgrfs", ConNewGRFReload, ConHookNewGRFDeveloperTool); + IConsoleCmdRegister("do_disaster", ConDoDisaster, ConHookNewGRFDeveloperTool, true); /* Bug workarounds */ IConsoleCmdRegister("jgrpp_bug_workaround_unblock_heliports", ConResetBlockedHeliports, ConHookNoNetwork, true); diff --git a/src/disaster_vehicle.cpp b/src/disaster_vehicle.cpp index 647fed51ce..3892c7f882 100644 --- a/src/disaster_vehicle.cpp +++ b/src/disaster_vehicle.cpp @@ -905,7 +905,7 @@ static const Disaster _disasters[] = { {Disaster_CoalMine_Init, 1950, 1985}, // coalmine }; -static void DoDisaster() +void DoDisaster() { byte buf[lengthof(_disasters)];