From 6f5f3101b6e785b88de2470babdb3b5a1a61f054 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 11 Feb 2006 09:24:51 +0000 Subject: [PATCH] (svn r3588) - Refit: Use only one global to return the refit capacity rather than one per vehicle type. --- aircraft_cmd.c | 2 +- aircraft_gui.c | 2 +- train_cmd.c | 2 +- train_gui.c | 2 +- variables.h | 1 - vehicle.h | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/aircraft_cmd.c b/aircraft_cmd.c index 75aacb6a99..5d2b32c2c2 100644 --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -498,7 +498,7 @@ int32 CmdRefitAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) pass /= 4; break; } - _aircraft_refit_capacity = pass; + _returned_refit_capacity = pass; cost = 0; if (IS_HUMAN_PLAYER(v->owner) && new_cid != v->cargo_type) { diff --git a/aircraft_gui.c b/aircraft_gui.c index 607fa3d2eb..249b66cff5 100644 --- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -249,7 +249,7 @@ static void AircraftRefitWndProc(Window *w, WindowEvent *e) if (!CmdFailed(cost)) { SetDParam(2, cost); SetDParam(0, _cargoc.names_long[WP(w,refit_d).cargo]); - SetDParam(1, _aircraft_refit_capacity); + SetDParam(1, _returned_refit_capacity); DrawString(1, 147, STR_A041_NEW_CAPACITY_COST_OF_REFIT, 0); } } diff --git a/train_cmd.c b/train_cmd.c index 06cc308555..bb6b97e3d9 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -1728,7 +1728,7 @@ int32 CmdRefitRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) } } while ( (v=v->next) != NULL ); - _returned_refit_amount = num; + _returned_refit_capacity = num; return cost; } diff --git a/train_gui.c b/train_gui.c index ede95848cc..68d06179ed 100644 --- a/train_gui.c +++ b/train_gui.c @@ -819,7 +819,7 @@ static void RailVehicleRefitWndProc(Window *w, WindowEvent *e) if (!CmdFailed(cost)) { SetDParam(2, cost); SetDParam(0, _cargoc.names_long[WP(w,refit_d).cargo]); - SetDParam(1, _returned_refit_amount); + SetDParam(1, _returned_refit_capacity); DrawString(1, 137, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0); } } diff --git a/variables.h b/variables.h index 2ad7c0b475..1d0b4802d6 100644 --- a/variables.h +++ b/variables.h @@ -293,7 +293,6 @@ VARDEF TileIndex _terraform_err_tile; VARDEF TileIndex _build_tunnel_endtile; VARDEF bool _generating_world; VARDEF int _new_town_size; -VARDEF uint _returned_refit_amount; // Deals with the type of the savegame, independent of extension typedef struct { diff --git a/vehicle.h b/vehicle.h index ef66b63dc9..5936c62fa3 100644 --- a/vehicle.h +++ b/vehicle.h @@ -418,7 +418,7 @@ VARDEF VehicleID _new_aircraft_id; VARDEF VehicleID _new_ship_id; VARDEF VehicleID _new_roadveh_id; VARDEF VehicleID _new_vehicle_id; -VARDEF uint16 _aircraft_refit_capacity; +VARDEF uint16 _returned_refit_capacity; VARDEF byte _cmd_build_rail_veh_score; #define INVALID_VEHICLE 0xFFFF