summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2012-01-22 22:21:21 +0000
committermichi_cc <michi_cc@openttd.org>2012-01-22 22:21:21 +0000
commit52b951ca6ffda7c465bd8ca3bfdb7ecdfe211a5b (patch)
tree7d3acf3780f3ec66b5aac4255cf3fb12bba966e9 /src/economy.cpp
parentb888027dddfd448a99116cfb82e3608c0c5ae7bd (diff)
downloadopenttd-52b951ca6ffda7c465bd8ca3bfdb7ecdfe211a5b.tar.xz
(svn r23844) -Fix (r23414): Infrastructure count for stations wasn't updated properly on company takeover. And don't count buoys while loading a game either.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index d5652cd49..6e08b8638 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -471,6 +471,9 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
UpdateSignalsInBuffer();
}
+ /* Add airport infrastructure count of the old company to the new one. */
+ if (new_owner != INVALID_OWNER) Company::Get(new_owner)->infrastructure.airport += Company::Get(old_owner)->infrastructure.airport;
+
/* convert owner of stations (including deleted ones, but excluding buoys) */
Station *st;
FOR_ALL_STATIONS(st) {