(svn r3893) - Fix: Properly set back the owner of a crossing/road-under bridge after removing it. For crossings we can always use .m2 because it is already 0 when not owned by a town.

This commit is contained in:
Darkvater
2006-03-15 21:27:19 +00:00
parent 7cdf803d0b
commit a390b6e4d1
2 changed files with 3 additions and 4 deletions

View File

@@ -714,7 +714,8 @@ static int32 DoClearBridge(TileIndex tile, uint32 flags)
if (GB(_m[c].m5, 3, 2) == TRANSPORT_RAIL) {
MakeRailNormal(c, GetTileOwner(c), _m[c].m5 & 1 ? TRACK_BIT_X : TRACK_BIT_Y, GB(_m[c].m3, 0, 3));
} else {
MakeRoadNormal(c, GetTileOwner(c), _m[c].m5 & 1 ? ROAD_X : ROAD_Y, 0); // XXX Determine town, missing till now
uint town = IsTileOwner(c, OWNER_TOWN) ? ClosestTownFromTile(c, (uint)-1)->index : 0;
MakeRoadNormal(c, GetTileOwner(c), _m[c].m5 & 1 ? ROAD_X : ROAD_Y, town);
}
MarkTileDirtyByTile(c);
} else {