src/vehicle.cpp
changeset 8640 1e93b81e96d2
parent 8636 2b158acb649c
child 8653 a83f7a536919
--- a/src/vehicle.cpp	Thu Dec 27 13:25:23 2007 +0000
+++ b/src/vehicle.cpp	Thu Dec 27 13:35:39 2007 +0000
@@ -12,7 +12,6 @@
 #include "table/strings.h"
 #include "tile_cmd.h"
 #include "landscape.h"
-#include "vehicle.h"
 #include "timetable.h"
 #include "viewport.h"
 #include "news.h"
@@ -43,10 +42,16 @@
 #include "functions.h"
 #include "date_func.h"
 #include "window_func.h"
+#include "vehicle_func.h"
 
 #define INVALID_COORD (0x7fffffff)
 #define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
 
+VehicleID _vehicle_id_ctr_day;
+Vehicle *_place_clicked_vehicle;
+VehicleID _new_vehicle_id;
+uint16 _returned_refit_capacity;
+
 
 /* Tables used in vehicle.h to find the right command for a certain vehicle type */
 const uint32 _veh_build_proc_table[] = {
@@ -3182,3 +3187,15 @@
 	this->sprite_height = 1;
 	this->z_height      = 1;
 }
+
+void StopAllVehicles()
+{
+	Vehicle *v;
+	FOR_ALL_VEHICLES(v) {
+		/* Code ripped from CmdStartStopTrain. Can't call it, because of
+		 * ownership problems, so we'll duplicate some code, for now */
+		v->vehstatus |= VS_STOPPED;
+		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
+	}
+}