(svn r3098) static, const, uint -> TileIndex, indentation, bracing, unused return values, ... mostly related to the clone vehicle GUI
authortron
Fri, 28 Oct 2005 20:04:54 +0000
changeset 2561 c78c3d248897
parent 2560 00ad0c27c2f3
child 2562 9397cf08c273
(svn r3098) static, const, uint -> TileIndex, indentation, bracing, unused return values, ... mostly related to the clone vehicle GUI
aircraft_cmd.c
aircraft_gui.c
gui.h
roadveh_gui.c
ship_gui.c
train_cmd.c
train_gui.c
vehicle.h
--- a/aircraft_cmd.c	Fri Oct 28 00:18:57 2005 +0000
+++ b/aircraft_cmd.c	Fri Oct 28 20:04:54 2005 +0000
@@ -328,7 +328,7 @@
 				(_m[tile].m5 == 32 || _m[tile].m5 == 65 || _m[tile].m5 == 86);
 }
 
-bool CheckStoppedInHangar(Vehicle *v)
+bool CheckStoppedInHangar(const Vehicle* v)
 {
 	if (!(v->vehstatus & VS_STOPPED) || !IsAircraftHangarTile(v->tile)) {
 		_error_message = STR_A01B_AIRCRAFT_MUST_BE_STOPPED;
--- a/aircraft_gui.c	Fri Oct 28 00:18:57 2005 +0000
+++ b/aircraft_gui.c	Fri Oct 28 20:04:54 2005 +0000
@@ -91,10 +91,9 @@
 
 void CcCloneAircraft(bool success, uint tile, uint32 p1, uint32 p2)
 {
-	Vehicle *v;
+	if (success) {
+		const Vehicle* v = GetVehicle(_new_aircraft_id);
 
-	if (success) {
-		v = GetVehicle(_new_aircraft_id);
 		ShowAircraftViewWindow(v);
 	}
 }
@@ -303,7 +302,7 @@
 	AircraftRefitWndProc
 };
 
-static void ShowAircraftRefitWindow(Vehicle *v)
+static void ShowAircraftRefitWindow(const Vehicle* v)
 {
 	Window *w;
 
@@ -468,7 +467,7 @@
 };
 
 
-static void ShowAircraftDetailsWindow(Vehicle *v)
+static void ShowAircraftDetailsWindow(const Vehicle* v)
 {
 	Window *w;
 	VehicleID veh = v->index;
@@ -503,7 +502,7 @@
 { WIDGETS_END }
 };
 
-bool CheckStoppedInHangar(Vehicle *v);
+bool CheckStoppedInHangar(const Vehicle* v); /* XXX extern function declaration in .c */
 
 static void AircraftViewWndProc(Window *w, WindowEvent *e)
 {
@@ -570,9 +569,9 @@
 	} break;
 
 	case WE_CLICK: {
-		Vehicle *v = GetVehicle(w->window_number);
+		const Vehicle* v = GetVehicle(w->window_number);
 
-		switch(e->click.widget) {
+		switch (e->click.widget) {
 		case 5: /* start stop */
 			DoCommandP(v->tile, v->index, 0, NULL, CMD_START_STOP_AIRCRAFT | CMD_MSG(STR_A016_CAN_T_STOP_START_AIRCRAFT));
 			break;
@@ -591,12 +590,10 @@
 		case 10: /* show details */
 			ShowAircraftDetailsWindow(v);
 			break;
-		case 11: {
+		case 11:
 			/* clone vehicle */
-			Vehicle *v;
-			v = GetVehicle(w->window_number);
 			DoCommandP(v->tile, v->index, _ctrl_pressed ? 1 : 0, CcCloneAircraft, CMD_CLONE_VEHICLE | CMD_MSG(STR_A008_CAN_T_BUILD_AIRCRAFT));
-		} break;
+			break;
 		}
 	} break;
 
@@ -613,18 +610,15 @@
 		DeleteWindowById(WC_VEHICLE_DETAILS, w->window_number);
 		break;
 
-		       case WE_MOUSELOOP:
-               {
-                       Vehicle *v;
-                       uint32 h;
-                       v = GetVehicle(w->window_number);
-                       h = CheckStoppedInHangar(v) ? (1<< 7) : (1 << 11);
-                       if (h != w->hidden_state) {
-                               w->hidden_state = h;
-                               SetWindowDirty(w);
-                       }
-               } break;
+	case WE_MOUSELOOP: {
+		const Vehicle* v = GetVehicle(w->window_number);
+		uint32 h = CheckStoppedInHangar(v) ? (1 << 7) : (1 << 11);
 
+		if (h != w->hidden_state) {
+			w->hidden_state = h;
+			SetWindowDirty(w);
+		}
+	} break;
 	}
 }
 
@@ -638,12 +632,11 @@
 };
 
 
-void ShowAircraftViewWindow(Vehicle *v)
+void ShowAircraftViewWindow(const Vehicle* v)
 {
-	Window *w;
+	Window* w = AllocateWindowDescFront(&_aircraft_view_desc, v->index);
 
-	w = AllocateWindowDescFront(&_aircraft_view_desc, v->index);
-	if (w) {
+	if (w != NULL) {
 		w->caption_color = v->owner;
 		AssignWindowViewport(w, 3, 17, 0xE2, 0x54, w->window_number | (1 << 31), 0);
 	}
@@ -769,34 +762,22 @@
  * @param *v is the original vehicle to clone
  * @param *w is the window of the hangar where the clone is build
  */
-static bool HandleCloneVehClick(Vehicle *v, Window *w)
+static void HandleCloneVehClick(const Vehicle* v, const Window* w)
 {
-
-	if (!v){
-		return false;
-	}
+	if (v == NULL || v->type != VEH_Aircraft) return;
 
-	if (v->type != VEH_Aircraft) {
-		// it's not an aircraft, do nothing
-		return false;
-	}
-
-
-    DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0,CcCloneAircraft,CMD_CLONE_VEHICLE | CMD_MSG(STR_A008_CAN_T_BUILD_AIRCRAFT));
+	DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0,
+		CcCloneAircraft, CMD_CLONE_VEHICLE | CMD_MSG(STR_A008_CAN_T_BUILD_AIRCRAFT)
+	);
 
 	ResetObjectToPlace();
-
-	return true;
 }
 
-static void ClonePlaceObj(uint tile, Window *w)
+static void ClonePlaceObj(TileIndex tile, const Window* w)
 {
-	Vehicle *v;
+	const Vehicle* v = CheckMouseOverVehicle();
 
-
-	v = CheckMouseOverVehicle();
-	if (v && HandleCloneVehClick(v, w))
-		return;
+	if (v != NULL) HandleCloneVehClick(v, w);
 }
 
 
@@ -817,17 +798,18 @@
 			ShowBuildAircraftWindow(w->window_number);
 			break;
 
-				case 8: /* clone button */
+		case 8: /* clone button */
 			InvalidateWidget(w, 8);
-				TOGGLEBIT(w->click_state, 8);
+			TOGGLEBIT(w->click_state, 8);
 
-				if (HASBIT(w->click_state, 8)) {
-					_place_clicked_vehicle = NULL;
-					SetObjectToPlaceWnd(SPR_CURSOR_CLONE, VHM_RECT, w);
-				} else {
-					ResetObjectToPlace();
-				}
-					break;
+			if (HASBIT(w->click_state, 8)) {
+				_place_clicked_vehicle = NULL;
+				SetObjectToPlaceWnd(SPR_CURSOR_CLONE, VHM_RECT, w);
+			} else {
+				ResetObjectToPlace();
+			}
+			break;
+
 		case 9: /* scroll to tile */
 			ResetObjectToPlace();
 			ScrollMainWindowToTile(w->window_number);
@@ -835,8 +817,7 @@
 		}
 		break;
 
-
-case WE_PLACE_OBJ: {
+	case WE_PLACE_OBJ: {
 		ClonePlaceObj(e->place.tile, w);
 	} break;
 
@@ -847,11 +828,12 @@
 
 	// check if a vehicle in a depot was clicked..
 	case WE_MOUSELOOP: {
-		Vehicle *v = _place_clicked_vehicle;
+		const Vehicle* v = _place_clicked_vehicle;
+
 		// since OTTD checks all open depot windows, we will make sure that it triggers the one with a clicked clone button
 		if (v != NULL && HASBIT(w->click_state, 8)) {
 			_place_clicked_vehicle = NULL;
-			HandleCloneVehClick( v, w);
+			HandleCloneVehClick(v, w);
 		}
 	} break;
 
--- a/gui.h	Fri Oct 28 00:18:57 2005 +0000
+++ b/gui.h	Fri Oct 28 20:04:54 2005 +0000
@@ -40,11 +40,10 @@
 
 /* train_gui.c */
 void ShowPlayerTrains(PlayerID player, StationID station);
-void ShowTrainViewWindow(Vehicle *v);
-void ShowTrainDetailsWindow(Vehicle *v);
+void ShowTrainViewWindow(const Vehicle *v);
 void ShowOrdersWindow(const Vehicle* v);
 
-void ShowRoadVehViewWindow(Vehicle *v);
+void ShowRoadVehViewWindow(const Vehicle* v);
 
 /* road_gui.c */
 void ShowBuildRoadToolbar(void);
@@ -55,7 +54,7 @@
 void ShowBuildDocksToolbar(void);
 void ShowPlayerShips(PlayerID player, StationID station);
 
-void ShowShipViewWindow(Vehicle *v);
+void ShowShipViewWindow(const Vehicle* v);
 
 /* aircraft_gui.c */
 void ShowBuildAirToolbar(void);
--- a/roadveh_gui.c	Fri Oct 28 00:18:57 2005 +0000
+++ b/roadveh_gui.c	Fri Oct 28 20:04:54 2005 +0000
@@ -211,7 +211,7 @@
 	RoadVehDetailsWndProc
 };
 
-static void ShowRoadVehDetailsWindow(Vehicle *v)
+static void ShowRoadVehDetailsWindow(const Vehicle* v)
 {
 	Window *w;
 	VehicleID veh = v->index;
@@ -225,12 +225,11 @@
 
 void CcCloneRoadVeh(bool success, uint tile, uint32 p1, uint32 p2)
 {
-	Vehicle *v;
+	if (success) {
+		const Vehicle* v = GetVehicle(_new_aircraft_id);
 
-	if (!success) return;
-
-	v = GetVehicle(_new_roadveh_id);
-	ShowRoadVehViewWindow(v);
+		ShowRoadVehViewWindow(v);
+	}
 }
 
 static void RoadVehViewWndProc(Window *w, WindowEvent *e)
@@ -290,9 +289,9 @@
 	} break;
 
 	case WE_CLICK: {
-		Vehicle *v = GetVehicle(w->window_number);
+		const Vehicle* v = GetVehicle(w->window_number);
 
-		switch(e->click.widget) {
+		switch (e->click.widget) {
 		case 5: /* start stop */
 			DoCommandP(v->tile, v->index, 0, NULL, CMD_START_STOP_ROADVEH | CMD_MSG(STR_9015_CAN_T_STOP_START_ROAD_VEHICLE));
 			break;
@@ -313,8 +312,6 @@
 			break;
 		case 11: {
 			/* clone vehicle */
-			Vehicle *v;
-			v = GetVehicle(w->window_number);
 			DoCommandP(v->tile, v->index, _ctrl_pressed ? 1 : 0, CcCloneRoadVeh, CMD_CLONE_VEHICLE | CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE));
 			} break;
 		}
@@ -372,12 +369,11 @@
 	RoadVehViewWndProc,
 };
 
-void ShowRoadVehViewWindow(Vehicle *v)
+void ShowRoadVehViewWindow(const Vehicle* v)
 {
-	Window *w;
+	Window* w = AllocateWindowDescFront(&_roadveh_view_desc, v->index);
 
-	w = AllocateWindowDescFront(&_roadveh_view_desc, v->index);
-	if (w) {
+	if (w != NULL) {
 		w->caption_color = v->owner;
 		AssignWindowViewport(w, 3, 17, 0xE2, 0x54, w->window_number | (1 << 31), 0);
 	}
@@ -667,34 +663,22 @@
  * @param *v is the original vehicle to clone
  * @param *w is the window of the depot where the clone is build
  */
-static bool HandleCloneVehClick(Vehicle *v, Window *w)
+static void HandleCloneVehClick(const Vehicle* v, const Window* w)
 {
-
-	if (!v){
-		return false;
-	}
+	if (v == NULL || v->type != VEH_Road) return;
 
-	if (v->type != VEH_Road) {
-		// it's not a road vehicle, do nothing
-		return false;
-	}
-
-
-    DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0,CcCloneRoadVeh,CMD_CLONE_VEHICLE | CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE));
+	DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0, CcCloneRoadVeh,
+		CMD_CLONE_VEHICLE | CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE)
+	);
 
 	ResetObjectToPlace();
-
-	return true;
 }
 
-static void ClonePlaceObj(uint tile, Window *w)
+static void ClonePlaceObj(TileIndex tile, const Window* w)
 {
-	Vehicle *v;
+	const Vehicle* v = CheckMouseOverVehicle();
 
-
-	v = CheckMouseOverVehicle();
-	if (v && HandleCloneVehClick(v, w))
-		return;
+	if (v != NULL) HandleCloneVehClick(v, w);
 }
 
 static void RoadDepotWndProc(Window *w, WindowEvent *e)
@@ -734,7 +718,7 @@
 		}
 	} break;
 
-		case WE_PLACE_OBJ: {
+	case WE_PLACE_OBJ: {
 		ClonePlaceObj(e->place.tile, w);
 	} break;
 
@@ -745,11 +729,12 @@
 
 	// check if a vehicle in a depot was clicked..
 	case WE_MOUSELOOP: {
-		Vehicle *v = _place_clicked_vehicle;
-	// since OTTD checks all open depot windows, we will make sure that it triggers the one with a clicked clone button
+		const Vehicle* v = _place_clicked_vehicle;
+
+		// since OTTD checks all open depot windows, we will make sure that it triggers the one with a clicked clone button
 		if (v != NULL && HASBIT(w->click_state, 8)) {
 			_place_clicked_vehicle = NULL;
-			HandleCloneVehClick( v, w);
+			HandleCloneVehClick(v, w);
 		}
 	} break;
 
--- a/ship_gui.c	Fri Oct 28 00:18:57 2005 +0000
+++ b/ship_gui.c	Fri Oct 28 20:04:54 2005 +0000
@@ -138,7 +138,7 @@
 	ShipRefitWndProc,
 };
 
-static void ShowShipRefitWindow(Vehicle *v)
+static void ShowShipRefitWindow(const Vehicle* v)
 {
 	Window *w;
 
@@ -287,7 +287,7 @@
 	ShipDetailsWndProc
 };
 
-static void ShowShipDetailsWindow(Vehicle *v)
+static void ShowShipDetailsWindow(const Vehicle* v)
 {
 	Window *w;
 	VehicleID veh = v->index;
@@ -314,11 +314,11 @@
 
 void CcCloneShip(bool success, uint tile, uint32 p1, uint32 p2)
 {
-	Vehicle *v;
-	if (!success) return;
+	if (success) {
+		const Vehicle* v = GetVehicle(_new_aircraft_id);
 
-	v = GetVehicle(_new_ship_id);
-	ShowShipViewWindow(v);
+		ShowShipViewWindow(v);
+	}
 }
 
 static void NewShipWndProc(Window *w, WindowEvent *e)
@@ -528,9 +528,9 @@
 	} break;
 
 		case WE_CLICK: {
-			Vehicle *v = GetVehicle(w->window_number);
+			const Vehicle* v = GetVehicle(w->window_number);
 
-			switch(e->click.widget) {
+			switch (e->click.widget) {
 				case 5: /* start stop */
 					DoCommandP(v->tile, v->index, 0, NULL, CMD_START_STOP_SHIP | CMD_MSG(STR_9818_CAN_T_STOP_START_SHIP));
 					break;
@@ -551,8 +551,6 @@
 					break;
 				case 11: {
 					/* clone vehicle */
-					Vehicle *v;
-					v = GetVehicle(w->window_number);
 					DoCommandP(v->tile, v->index, _ctrl_pressed ? 1 : 0, CcCloneShip, CMD_CLONE_VEHICLE | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP));
 				} break;
 			}
@@ -611,12 +609,11 @@
 	ShipViewWndProc
 };
 
-void ShowShipViewWindow(Vehicle *v)
+void ShowShipViewWindow(const Vehicle* v)
 {
-	Window *w;
+	Window* w = AllocateWindowDescFront(&_ship_view_desc, v->index);
 
-	w = AllocateWindowDescFront(&_ship_view_desc, v->index);
-	if (w) {
+	if (w != NULL) {
 		w->caption_color = v->owner;
 		AssignWindowViewport(w, 3, 17, 0xE2, 0x54, w->window_number | (1 << 31), 0);
 	}
@@ -745,34 +742,22 @@
  * @param *v is the original vehicle to clone
  * @param *w is the window of the depot where the clone is build
  */
-static bool HandleCloneVehClick(Vehicle *v, Window *w)
+static void HandleCloneVehClick(const Vehicle* v, const Window* w)
 {
-
-	if (!v){
-		return false;
-	}
+	if (v == NULL || v->type != VEH_Ship) return;
 
-	if (v->type != VEH_Ship) {
-		// it's not a ship, do nothing
-		return false;
-	}
-
-
-    DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0,CcCloneShip,CMD_CLONE_VEHICLE | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP));
+	DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0, CcCloneShip,
+		CMD_CLONE_VEHICLE | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP)
+	);
 
 	ResetObjectToPlace();
-
-	return true;
 }
 
-static void ClonePlaceObj(uint tile, Window *w)
+static void ClonePlaceObj(TileIndex tile, const Window* w)
 {
-	Vehicle *v;
+	Vehicle* v = CheckMouseOverVehicle();
 
-
-	v = CheckMouseOverVehicle();
-	if (v && HandleCloneVehClick(v, w))
-		return;
+	if (v != NULL) HandleCloneVehClick(v, w);
 }
 
 static void ShipDepotWndProc(Window *w, WindowEvent *e) {
@@ -812,7 +797,6 @@
 		break;
 
 	case WE_PLACE_OBJ: {
-		//ClonePlaceObj(e->place.tile, w);
 		ClonePlaceObj(w->window_number, w);
 	} break;
 
@@ -823,9 +807,9 @@
 
 	// check if a vehicle in a depot was clicked..
 	case WE_MOUSELOOP: {
-		Vehicle *v = _place_clicked_vehicle;
+		const Vehicle* v = _place_clicked_vehicle;
 
-	// since OTTD checks all open depot windows, we will make sure that it triggers the one with a clicked clone button
+		// since OTTD checks all open depot windows, we will make sure that it triggers the one with a clicked clone button
 		if (v != NULL && HASBIT(w->click_state, 8)) {
 			_place_clicked_vehicle = NULL;
 			HandleCloneVehClick(v, w);
--- a/train_cmd.c	Fri Oct 28 00:18:57 2005 +0000
+++ b/train_cmd.c	Fri Oct 28 20:04:54 2005 +0000
@@ -4,6 +4,7 @@
 #include "openttd.h"
 #include "debug.h"
 #include "functions.h"
+#include "gui.h"
 #include "table/strings.h"
 #include "map.h"
 #include "tile.h"
@@ -27,7 +28,6 @@
 
 static bool TrainCheckIfLineEnds(Vehicle *v);
 static void TrainController(Vehicle *v);
-extern void ShowTrainViewWindow(Vehicle *v);
 
 static const byte _vehicle_initial_x_fract[4] = {10,8,4,8};
 static const byte _vehicle_initial_y_fract[4] = {8,4,8,10};
--- a/train_gui.c	Fri Oct 28 00:18:57 2005 +0000
+++ b/train_gui.c	Fri Oct 28 20:04:54 2005 +0000
@@ -163,13 +163,11 @@
 
 void CcCloneTrain(bool success, uint tile, uint32 p1, uint32 p2)
 {
-	Vehicle *v;
+	if (success) {
+		const Vehicle* v = GetVehicle(_new_aircraft_id);
 
-	if (!success)
-		return;
-
-	v = GetVehicle(_new_train_id);
-	ShowTrainViewWindow(v);
+		ShowTrainViewWindow(v);
+	}
 }
 
 static void engine_drawing_loop(int *x, int *y, int *pos, int *sel,
@@ -604,40 +602,29 @@
  * @param *v is the original vehicle to clone
  * @param *w is the window of the depot where the clone is build
  */
-static bool HandleCloneVehClick(Vehicle *v, Window *w)
+static void HandleCloneVehClick(const Vehicle* v, const Window* w)
 {
-
-	if (!v){
-		return false;
-	}
+	if (v == NULL || v->type != VEH_Train) return;
 
 	// for train vehicles: subtype 0 for locs and not zero for others
-	if (v->type == VEH_Train && v->subtype != 0) {
+	if (v->subtype != TS_Front_Engine) {
 		v = GetFirstVehicleInChain(v);
-		if (v->subtype != 0) // This happens when clicking on a train in depot with no loc attached
-			return false;
-	}else{
-		if (v->type != VEH_Train) {
-			// it's not a train, Do Nothing
-			return false;
-		}
+		// Do nothing when clicking on a train in depot with no loc attached
+		if (v->subtype != TS_Front_Engine) return;
 	}
 
-    DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0, CcCloneTrain, CMD_CLONE_VEHICLE | CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE));
+	DoCommandP(w->window_number, v->index, _ctrl_pressed ? 1 : 0, CcCloneTrain,
+		CMD_CLONE_VEHICLE | CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE)
+	);
 
 	ResetObjectToPlace();
-
-	return true;
 }
 
-static void ClonePlaceObj(uint tile, Window *w)
+static void ClonePlaceObj(TileIndex tile, const Window* w)
 {
-	Vehicle *v;
+	Vehicle* v = CheckMouseOverVehicle();
 
-
-	v = CheckMouseOverVehicle();
-	if (v && HandleCloneVehClick(v, w))
-		return;
+	if (v != NULL) HandleCloneVehClick(v, w);
 }
 
 static void TrainDepotWndProc(Window *w, WindowEvent *e)
@@ -686,11 +673,12 @@
 
 	// check if a vehicle in a depot was clicked..
 	case WE_MOUSELOOP: {
-		Vehicle *v = _place_clicked_vehicle;
-	// since OTTD checks all open depot windows, we will make sure that it triggers the one with a clicked clone button
+		const Vehicle* v = _place_clicked_vehicle;
+
+		// since OTTD checks all open depot windows, we will make sure that it triggers the one with a clicked clone button
 		if (v != NULL && HASBIT(w->click_state, 9)) {
 			_place_clicked_vehicle = NULL;
-			HandleCloneVehClick( v, w);
+			HandleCloneVehClick(v, w);
 		}
 	} break;
 
@@ -907,6 +895,8 @@
 { WIDGETS_END }
 };
 
+static void ShowTrainDetailsWindow(const Vehicle* v);
+
 static void TrainViewWndProc(Window *w, WindowEvent *e)
 {
 	switch (e->event) {
@@ -1063,12 +1053,11 @@
 	TrainViewWndProc
 };
 
-void ShowTrainViewWindow(Vehicle *v)
+void ShowTrainViewWindow(const Vehicle* v)
 {
-	Window *w;
+	Window* w = AllocateWindowDescFront(&_train_view_desc,v->index);
 
-	w = AllocateWindowDescFront(&_train_view_desc,v->index);
-	if (w) {
+	if (w != NULL) {
 		w->caption_color = v->owner;
 		AssignWindowViewport(w, 3, 17, 0xE2, 0x66, w->window_number | (1 << 31), 0);
 	}
@@ -1320,7 +1309,7 @@
 };
 
 
-void ShowTrainDetailsWindow(Vehicle *v)
+static void ShowTrainDetailsWindow(const Vehicle* v)
 {
 	Window *w;
 	VehicleID veh = v->index;
--- a/vehicle.h	Fri Oct 28 00:18:57 2005 +0000
+++ b/vehicle.h	Fri Oct 28 20:04:54 2005 +0000
@@ -315,7 +315,7 @@
 void EndVehicleMove(Vehicle *v);
 
 bool IsAircraftHangarTile(TileIndex tile);
-void ShowAircraftViewWindow(Vehicle *v);
+void ShowAircraftViewWindow(const Vehicle* v);
 
 UnitID GetFreeUnitNumber(byte type);