(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.

This commit is contained in:
michi_cc
2012-01-22 22:21:21 +00:00
parent abdd5ebfa7
commit f2fc765290
3 changed files with 38 additions and 10 deletions

View File

@@ -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) {