(svn r23920) -Fix: Consider only the middle tile of a lock for lock-infrastructure costs. The other two tiles may be owned by other companies. Also do not count the middle tile of a lock as canal, independent of whether it is build on ground or river slope.

This commit is contained in:
frosch
2012-02-09 22:38:39 +00:00
parent 5012ea91ef
commit 07f69d8b88
2 changed files with 15 additions and 7 deletions

View File

@@ -173,7 +173,14 @@ void AfterLoadCompanyStats()
case MP_WATER:
if (IsShipDepot(tile) || IsLock(tile)) {
c = Company::GetIfValid(GetTileOwner(tile));
if (c != NULL) c->infrastructure.water += LOCK_DEPOT_TILE_FACTOR;
if (c != NULL) {
if (IsShipDepot(tile)) c->infrastructure.water += LOCK_DEPOT_TILE_FACTOR;
if (IsLock(tile) && GetLockPart(tile) == LOCK_PART_MIDDLE) {
/* The middle tile specifies the owner of the lock. */
c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // the middle tile specifies the owner of the
break; // do not count the middle tile as canal
}
}
}
/* FALL THROUGH */