src/console_cmds.cpp
changeset 8640 1e93b81e96d2
parent 8636 2b158acb649c
child 8704 2857ec554839
equal deleted inserted replaced
8639:afebb18ecef5 8640:1e93b81e96d2
    17 #include "network/network_udp.h"
    17 #include "network/network_udp.h"
    18 #include "command_func.h"
    18 #include "command_func.h"
    19 #include "settings.h"
    19 #include "settings.h"
    20 #include "fios.h"
    20 #include "fios.h"
    21 #include "fileio.h"
    21 #include "fileio.h"
    22 #include "vehicle.h"
       
    23 #include "station.h"
    22 #include "station.h"
    24 #include "screenshot.h"
    23 #include "screenshot.h"
    25 #include "genworld.h"
    24 #include "genworld.h"
    26 #include "network/network.h"
    25 #include "network/network.h"
    27 #include "strings_func.h"
    26 #include "strings_func.h"
    28 #include "viewport.h"
    27 #include "viewport.h"
    29 #include "window_func.h"
    28 #include "window_func.h"
    30 #include "functions.h"
    29 #include "functions.h"
    31 #include "map_func.h"
    30 #include "map_func.h"
    32 #include "date_func.h"
    31 #include "date_func.h"
       
    32 #include "vehicle_func.h"
    33 
    33 
    34 // ** scriptfile handling ** //
    34 // ** scriptfile handling ** //
    35 static FILE *_script_file;
    35 static FILE *_script_file;
    36 static bool _script_running;
    36 static bool _script_running;
    37 
    37 
   135 	return false;
   135 	return false;
   136 }
   136 }
   137 
   137 
   138 DEF_CONSOLE_CMD(ConStopAllVehicles)
   138 DEF_CONSOLE_CMD(ConStopAllVehicles)
   139 {
   139 {
   140 	Vehicle* v;
       
   141 	if (argc == 0) {
   140 	if (argc == 0) {
   142 		IConsoleHelp("Stops all vehicles in the game. For debugging only! Use at your own risk... Usage: 'stopall'");
   141 		IConsoleHelp("Stops all vehicles in the game. For debugging only! Use at your own risk... Usage: 'stopall'");
   143 		return true;
   142 		return true;
   144 	}
   143 	}
   145 
   144 
   146 	FOR_ALL_VEHICLES(v) {
   145 	StopAllVehicles();
   147 		/* Code ripped from CmdStartStopTrain. Can't call it, because of
       
   148 		 * ownership problems, so we'll duplicate some code, for now */
       
   149 		v->vehstatus |= VS_STOPPED;
       
   150 		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
       
   151 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
       
   152 	}
       
   153 	return true;
   146 	return true;
   154 }
   147 }
   155 #endif /* _DEBUG */
   148 #endif /* _DEBUG */
   156 
   149 
   157 DEF_CONSOLE_CMD(ConScrollToTile)
   150 DEF_CONSOLE_CMD(ConScrollToTile)