(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:
@@ -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 */
|
||||
|
||||
|
Reference in New Issue
Block a user