src/vehicle.cpp
changeset 10693 2ce681c2f4cc
parent 10688 6c9df9bf9b04
child 10694 9f14c518f784
--- a/src/vehicle.cpp	Sat May 24 23:18:21 2008 +0000
+++ b/src/vehicle.cpp	Sun May 25 09:40:44 2008 +0000
@@ -58,7 +58,7 @@
 #define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
 
 VehicleID _vehicle_id_ctr_day;
-Vehicle *_place_clicked_vehicle;
+const Vehicle *_place_clicked_vehicle;
 VehicleID _new_vehicle_id;
 uint16 _returned_refit_capacity;
 
@@ -531,6 +531,12 @@
 	return v;
 }
 
+const Vehicle *GetLastVehicleInChain(const Vehicle *v)
+{
+	while (v->Next() != NULL) v = v->Next();
+	return v;
+}
+
 uint CountVehiclesInChain(const Vehicle* v)
 {
 	uint count = 0;