From f567bcdb373961b63f05db9f238009fc1932f841 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 15 Dec 2015 00:03:36 +0000 Subject: [PATCH] Fix _current_company being changed in VehicleServiceInDepot. _current_company is now restored when paying for a repair. --- src/vehicle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 3214a8e825..596c085696 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -100,6 +100,7 @@ void VehicleServiceInDepot(Vehicle *v) do { v->date_of_last_service = _date; if (_settings_game.vehicle.pay_for_repair && v->breakdowns_since_last_service) { + CompanyID old = _current_company; ExpensesType type = INVALID_EXPENSES; _current_company = v->owner; switch (v->type) { @@ -130,6 +131,7 @@ void VehicleServiceInDepot(Vehicle *v) v->First()->profit_this_year -= cost.GetCost() << 8; SubtractMoneyFromCompany(cost); ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost.GetCost()); + _current_company = old; } v->breakdowns_since_last_service = 0;