summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-07-28 14:18:58 +0000
committeryexo <yexo@openttd.org>2010-07-28 14:18:58 +0000
commitdd7800ea1889a6f02eeed2221e0c43e7f27851c2 (patch)
treec01eed00b68b9a8bca9028308b0ebccfc9cdb274 /src
parentfc6f336fee54e5f3e42c03cf331c33cf1592e8ef (diff)
downloadopenttd-dd7800ea1889a6f02eeed2221e0c43e7f27851c2.tar.xz
(svn r20234) -Fix [FS#3988]: refit costs from refit orders are subtracted from the vehicle yearly income
Diffstat (limited to 'src')
-rw-r--r--src/vehicle.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 963f3a042..9254b8837 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1131,8 +1131,11 @@ void VehicleEnterDepot(Vehicle *v)
SetDParam(0, v->index);
AddVehicleNewsItem(STR_NEWS_ORDER_REFIT_FAILED, NS_ADVICE, v->index);
}
- } else if (v->owner == _local_company && cost.GetCost() != 0) {
- ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost.GetCost());
+ } else if (cost.GetCost() != 0) {
+ v->profit_this_year -= cost.GetCost() << 8;
+ if (v->owner == _local_company) {
+ ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost.GetCost());
+ }
}
}