summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-09-19 12:48:12 +0000
committerbjarni <bjarni@openttd.org>2006-09-19 12:48:12 +0000
commit0858bf0d041cb59773c5c600d5179e4d4307c192 (patch)
treebd6d13a22e0901125e536f7a4b1f176def17475f
parentc52d029bd4ba90fd951b7059be43e07454a7570b (diff)
downloadopenttd-0858bf0d041cb59773c5c600d5179e4d4307c192.tar.xz
(svn r6479) -Fix r6424: FS#348 Plane autoreplace glitch
Now the num_engines array is updated for the buying player when merging two players The incorrect caches aren't saved so no savegames will contain incorrect data due to this bug
-rw-r--r--economy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/economy.c b/economy.c
index a9a6eb809..c2984123d 100644
--- a/economy.c
+++ b/economy.c
@@ -312,6 +312,7 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
DeleteVehicle(v);
} else {
v->owner = new_player;
+ if (IsEngineCountable(v)) GetPlayer(new_player)->num_engines[v->engine_type]++;
switch (v->type) {
case VEH_Train: if (IsFrontEngine(v)) v->unitnumber = ++num_train; break;
case VEH_Road: v->unitnumber = ++num_road; break;