mirror of https://github.com/OpenTTD/OpenTTD
(svn r3588) - Refit: Use only one global to return the refit capacity rather than one per vehicle type.
parent
1097ec2b62
commit
6f5f3101b6
|
@ -498,7 +498,7 @@ int32 CmdRefitAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
pass /= 4;
|
pass /= 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_aircraft_refit_capacity = pass;
|
_returned_refit_capacity = pass;
|
||||||
|
|
||||||
cost = 0;
|
cost = 0;
|
||||||
if (IS_HUMAN_PLAYER(v->owner) && new_cid != v->cargo_type) {
|
if (IS_HUMAN_PLAYER(v->owner) && new_cid != v->cargo_type) {
|
||||||
|
|
|
@ -249,7 +249,7 @@ static void AircraftRefitWndProc(Window *w, WindowEvent *e)
|
||||||
if (!CmdFailed(cost)) {
|
if (!CmdFailed(cost)) {
|
||||||
SetDParam(2, cost);
|
SetDParam(2, cost);
|
||||||
SetDParam(0, _cargoc.names_long[WP(w,refit_d).cargo]);
|
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);
|
DrawString(1, 147, STR_A041_NEW_CAPACITY_COST_OF_REFIT, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1728,7 +1728,7 @@ int32 CmdRefitRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
}
|
}
|
||||||
} while ( (v=v->next) != NULL );
|
} while ( (v=v->next) != NULL );
|
||||||
|
|
||||||
_returned_refit_amount = num;
|
_returned_refit_capacity = num;
|
||||||
|
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
|
|
@ -819,7 +819,7 @@ static void RailVehicleRefitWndProc(Window *w, WindowEvent *e)
|
||||||
if (!CmdFailed(cost)) {
|
if (!CmdFailed(cost)) {
|
||||||
SetDParam(2, cost);
|
SetDParam(2, cost);
|
||||||
SetDParam(0, _cargoc.names_long[WP(w,refit_d).cargo]);
|
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);
|
DrawString(1, 137, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,7 +293,6 @@ VARDEF TileIndex _terraform_err_tile;
|
||||||
VARDEF TileIndex _build_tunnel_endtile;
|
VARDEF TileIndex _build_tunnel_endtile;
|
||||||
VARDEF bool _generating_world;
|
VARDEF bool _generating_world;
|
||||||
VARDEF int _new_town_size;
|
VARDEF int _new_town_size;
|
||||||
VARDEF uint _returned_refit_amount;
|
|
||||||
|
|
||||||
// Deals with the type of the savegame, independent of extension
|
// Deals with the type of the savegame, independent of extension
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -418,7 +418,7 @@ VARDEF VehicleID _new_aircraft_id;
|
||||||
VARDEF VehicleID _new_ship_id;
|
VARDEF VehicleID _new_ship_id;
|
||||||
VARDEF VehicleID _new_roadveh_id;
|
VARDEF VehicleID _new_roadveh_id;
|
||||||
VARDEF VehicleID _new_vehicle_id;
|
VARDEF VehicleID _new_vehicle_id;
|
||||||
VARDEF uint16 _aircraft_refit_capacity;
|
VARDEF uint16 _returned_refit_capacity;
|
||||||
VARDEF byte _cmd_build_rail_veh_score;
|
VARDEF byte _cmd_build_rail_veh_score;
|
||||||
|
|
||||||
#define INVALID_VEHICLE 0xFFFF
|
#define INVALID_VEHICLE 0xFFFF
|
||||||
|
|
Loading…
Reference in New Issue