src/aircraft_cmd.cpp
changeset 6943 1914f26aee04
parent 6643 f81bee57bc09
child 6950 14ecb0acdfb4
--- a/src/aircraft_cmd.cpp	Mon Jun 18 08:17:31 2007 +0000
+++ b/src/aircraft_cmd.cpp	Mon Jun 18 10:48:15 2007 +0000
@@ -227,7 +227,7 @@
 	height = spr->height;
 }
 
-static int32 EstimateAircraftCost(EngineID engine, const AircraftVehicleInfo *avi)
+static CommandCost EstimateAircraftCost(EngineID engine, const AircraftVehicleInfo *avi)
 {
 	return GetEngineProperty(engine, 0x0B, avi->base_cost) * (_price.aircraft_base >> 3) >> 5;
 }
@@ -265,12 +265,12 @@
  * @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number
  * return result of operation.  Could be cost, error
  */
-int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	if (!IsEngineBuildable(p1, VEH_AIRCRAFT, _current_player)) return_cmd_error(STR_AIRCRAFT_NOT_AVAILABLE);
 
 	const AircraftVehicleInfo *avi = AircraftVehInfo(p1);
-	int32 value = EstimateAircraftCost(p1, avi);
+	CommandCost value = EstimateAircraftCost(p1, avi);
 
 	/* to just query the cost, it is not neccessary to have a valid tile (automation/AI) */
 	if (flags & DC_QUERY_COST) return value;
@@ -476,7 +476,7 @@
  * @param p2 unused
  * @return result of operation.  Error or sold value
  */
-int32 CmdSellAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdSellAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
 
@@ -503,7 +503,7 @@
  * @param p2 unused
  * @return result of operation.  Nothing if everything went well
  */
-int32 CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
 
@@ -546,7 +546,7 @@
  * - p2 bit 8-10 - VLW flag (for mass goto depot)
  * @return o if everything went well
  */
-int32 CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	if (p2 & DEPOT_MASS_SEND) {
 		/* Mass goto depot requested */
@@ -623,7 +623,7 @@
  * - p2 = (bit 16) - refit only this vehicle (ignored)
  * @return cost of refit or error
  */
-int32 CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	byte new_subtype = GB(p2, 8, 8);
 
@@ -668,7 +668,7 @@
 	}
 	_returned_refit_capacity = pass;
 
-	int32 cost = 0;
+	CommandCost cost = 0;
 	if (IsHumanPlayer(v->owner) && new_cid != v->cargo_type) {
 		cost = GetRefitCost(v->engine_type);
 	}
@@ -744,7 +744,7 @@
 
 	if (v->vehstatus & VS_STOPPED) return;
 
-	int32 cost = GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364;
+	CommandCost cost = GetVehicleProperty(v, 0x0E, AircraftVehInfo(v->engine_type)->running_cost) * _price.aircraft_running / 364;
 
 	v->profit_this_year -= cost >> 8;
 
@@ -1379,7 +1379,7 @@
 		 */
 		const Station *st = GetStation(v->u.air.targetairport);
 		if (!st->IsValid() || st->airport_tile == 0) {
-			int32 ret;
+			CommandCost ret;
 			PlayerID old_player = _current_player;
 
 			_current_player = v->owner;