From d30fcd4e354325af0d2b1968cd11c9db36a3e617 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sat, 3 Dec 2011 23:40:13 +0000 Subject: (svn r23411) -Add: Company infrastructure counts for rail. --- src/road_cmd.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/road_cmd.cpp') diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 5fc871bfb..0f560165e 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -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); } } -- cgit v1.2.3-54-g00ecf