Merge branch 'vehicle_repair_costs-sx' into jgrpp

This commit is contained in:
Jonathan G Rennison
2015-12-15 00:04:08 +00:00

View File

@@ -123,6 +123,7 @@ void VehicleServiceInDepot(Vehicle *v)
do { do {
v->date_of_last_service = _date; v->date_of_last_service = _date;
if (_settings_game.vehicle.pay_for_repair && v->breakdowns_since_last_service) { if (_settings_game.vehicle.pay_for_repair && v->breakdowns_since_last_service) {
CompanyID old = _current_company;
ExpensesType type = INVALID_EXPENSES; ExpensesType type = INVALID_EXPENSES;
_current_company = v->owner; _current_company = v->owner;
switch (v->type) { switch (v->type) {
@@ -153,6 +154,7 @@ void VehicleServiceInDepot(Vehicle *v)
v->First()->profit_this_year -= cost.GetCost() << 8; v->First()->profit_this_year -= cost.GetCost() << 8;
SubtractMoneyFromCompany(cost); SubtractMoneyFromCompany(cost);
ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost.GetCost()); ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost.GetCost());
_current_company = old;
} }
v->breakdowns_since_last_service = 0; v->breakdowns_since_last_service = 0;