mirror of https://github.com/OpenTTD/OpenTTD
(svn r4558) - Fix: 'stopall' was moved to debug, so move the function there as well.
parent
d7bc0293b1
commit
fd2a005139
|
@ -92,28 +92,6 @@ static void IConsoleHelp(const char *str)
|
||||||
IConsolePrintF(_icolour_warn, "- %s", str);
|
IConsolePrintF(_icolour_warn, "- %s", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEF_CONSOLE_CMD(ConStopAllVehicles)
|
|
||||||
{
|
|
||||||
Vehicle* v;
|
|
||||||
if (argc == 0) {
|
|
||||||
IConsoleHelp("Stops all vehicles in the game. For debugging only! Use at your own risk... Usage: 'stopall'");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
FOR_ALL_VEHICLES(v) {
|
|
||||||
if (IsValidVehicle(v)) {
|
|
||||||
/* Code ripped from CmdStartStopTrain. Can't call it, because of
|
|
||||||
* ownership problems, so we'll duplicate some code, for now */
|
|
||||||
if (v->type == VEH_Train)
|
|
||||||
v->u.rail.days_since_order_progr = 0;
|
|
||||||
v->vehstatus |= VS_STOPPED;
|
|
||||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
|
||||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEF_CONSOLE_CMD(ConResetEngines)
|
DEF_CONSOLE_CMD(ConResetEngines)
|
||||||
{
|
{
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
|
@ -144,6 +122,28 @@ DEF_CONSOLE_CMD(ConResetTile)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEF_CONSOLE_CMD(ConStopAllVehicles)
|
||||||
|
{
|
||||||
|
Vehicle* v;
|
||||||
|
if (argc == 0) {
|
||||||
|
IConsoleHelp("Stops all vehicles in the game. For debugging only! Use at your own risk... Usage: 'stopall'");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
FOR_ALL_VEHICLES(v) {
|
||||||
|
if (IsValidVehicle(v)) {
|
||||||
|
/* Code ripped from CmdStartStopTrain. Can't call it, because of
|
||||||
|
* ownership problems, so we'll duplicate some code, for now */
|
||||||
|
if (v->type == VEH_Train)
|
||||||
|
v->u.rail.days_since_order_progr = 0;
|
||||||
|
v->vehstatus |= VS_STOPPED;
|
||||||
|
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
|
||||||
|
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
#endif /* _DEBUG */
|
#endif /* _DEBUG */
|
||||||
|
|
||||||
DEF_CONSOLE_CMD(ConScrollToTile)
|
DEF_CONSOLE_CMD(ConScrollToTile)
|
||||||
|
|
Loading…
Reference in New Issue