(svn r23411) -Add: Company infrastructure counts for rail.

This commit is contained in:
michi_cc
2011-12-03 23:40:13 +00:00
parent b68ced52c4
commit 85ec2f07af
9 changed files with 255 additions and 4 deletions

View File

@@ -1671,6 +1671,10 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne
if (new_owner == INVALID_OWNER) {
DoCommand(tile, 0, GetCrossingRailTrack(tile), DC_EXEC | DC_BANKRUPT, CMD_REMOVE_SINGLE_RAIL);
} else {
/* Update infrastructure counts. No need to dirty windows here, we'll redraw the whole screen anyway. */
Company::Get(old_owner)->infrastructure.rail[GetRailType(tile)] -= LEVELCROSSING_TRACKBIT_FACTOR;
Company::Get(new_owner)->infrastructure.rail[GetRailType(tile)] += LEVELCROSSING_TRACKBIT_FACTOR;
SetTileOwner(tile, new_owner);
}
}