forked from mirror/OpenTTD
(svn r10258) -Codechange: as we are now using int64 all over the place, it's better to use int64 variables in the string generating too instead of packing them into two int32s.
-Fix: some displays of money were wrong.
This commit is contained in:
@@ -120,12 +120,12 @@ static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw)
|
||||
const RailVehicleInfo *rvi = RailVehInfo(engine);
|
||||
uint multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD) ? 1 : 0;
|
||||
|
||||
SetDParamMoney(0, (_price.build_railvehicle >> 3) * rvi->base_cost >> 5);
|
||||
SetDParam(0, (_price.build_railvehicle >> 3) * rvi->base_cost >> 5);
|
||||
SetDParam(2, rvi->max_speed * 10 / 16);
|
||||
SetDParam(3, rvi->power << multihead);
|
||||
SetDParam(1, rvi->weight << multihead);
|
||||
|
||||
SetDParamMoney(4, rvi->running_cost_base * _price.running_rail[rvi->running_cost_class] >> 8 << multihead);
|
||||
SetDParam(4, rvi->running_cost_base * _price.running_rail[rvi->running_cost_class] >> 8 << multihead);
|
||||
|
||||
if (rvi->capacity != 0) {
|
||||
SetDParam(5, rvi->cargo_type);
|
||||
@@ -139,11 +139,11 @@ static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw)
|
||||
static void DrawAircraftEngineInfo(EngineID engine, int x, int y, int maxw)
|
||||
{
|
||||
const AircraftVehicleInfo *avi = AircraftVehInfo(engine);
|
||||
SetDParamMoney(0, (_price.aircraft_base >> 3) * avi->base_cost >> 5);
|
||||
SetDParam(0, (_price.aircraft_base >> 3) * avi->base_cost >> 5);
|
||||
SetDParam(1, avi->max_speed * 10 / 16);
|
||||
SetDParam(2, avi->passenger_capacity);
|
||||
SetDParam(3, avi->mail_capacity);
|
||||
SetDParamMoney(4, avi->running_cost * _price.aircraft_running >> 8);
|
||||
SetDParam(4, avi->running_cost * _price.aircraft_running >> 8);
|
||||
|
||||
DrawStringMultiCenter(x, y, STR_A02E_COST_MAX_SPEED_CAPACITY, maxw);
|
||||
}
|
||||
@@ -152,9 +152,9 @@ static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw)
|
||||
{
|
||||
const RoadVehicleInfo *rvi = RoadVehInfo(engine);
|
||||
|
||||
SetDParamMoney(0, (_price.roadveh_base >> 3) * rvi->base_cost >> 5);
|
||||
SetDParam(0, (_price.roadveh_base >> 3) * rvi->base_cost >> 5);
|
||||
SetDParam(1, rvi->max_speed * 10 / 32);
|
||||
SetDParamMoney(2, rvi->running_cost * _price.roadveh_running >> 8);
|
||||
SetDParam(2, rvi->running_cost * _price.roadveh_running >> 8);
|
||||
SetDParam(3, rvi->cargo_type);
|
||||
SetDParam(4, rvi->capacity);
|
||||
|
||||
@@ -164,11 +164,11 @@ static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw)
|
||||
static void DrawShipEngineInfo(EngineID engine, int x, int y, int maxw)
|
||||
{
|
||||
const ShipVehicleInfo *svi = ShipVehInfo(engine);
|
||||
SetDParamMoney(0, svi->base_cost * (_price.ship_base >> 3) >> 5);
|
||||
SetDParam(0, svi->base_cost * (_price.ship_base >> 3) >> 5);
|
||||
SetDParam(1, svi->max_speed * 10 / 32);
|
||||
SetDParam(2, svi->cargo_type);
|
||||
SetDParam(3, svi->capacity);
|
||||
SetDParamMoney(4, svi->running_cost * _price.ship_running >> 8);
|
||||
SetDParam(4, svi->running_cost * _price.ship_running >> 8);
|
||||
DrawStringMultiCenter(x, y, STR_982E_COST_MAX_SPEED_CAPACITY, maxw);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user