summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-18 15:32:20 +0000
committerrubidium <rubidium@openttd.org>2008-09-18 15:32:20 +0000
commitee2a851aaba332795c405fc79270d9b7ab0ebb6d (patch)
tree3d6ce074168404353556606b4ac2279f4206b6c0 /src
parent001be23127f3f1f2ecddc6b341850c7ad418e4ac (diff)
downloadopenttd-ee2a851aaba332795c405fc79270d9b7ab0ebb6d.tar.xz
(svn r14359) -Fix [FS#2311]: the ownership of roadtiles was not properly set for very old savegames (including TTD's) making it impossible to remove some pieces of road.
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 1b690e2a2..ab6c44553 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1181,8 +1181,8 @@ static void ConvertTownOwner()
for (TileIndex tile = 0; tile != MapSize(); tile++) {
switch (GetTileType(tile)) {
case MP_ROAD:
- if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HasBit(_m[tile].m4, 7)) {
- _m[tile].m4 = OWNER_TOWN;
+ if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HasBit(_m[tile].m3, 7)) {
+ _m[tile].m3 = OWNER_TOWN;
}
/* FALLTHROUGH */
@@ -1565,7 +1565,7 @@ bool AfterLoadGame()
case MP_ROAD:
_m[t].m4 |= (_m[t].m2 << 4);
- if (IsTileOwner(t, OWNER_TOWN)) {
+ if ((GB(_m[t].m5, 4, 2) == ROAD_TILE_CROSSING ? (Owner)_m[t].m3 : GetTileOwner(t)) == OWNER_TOWN) {
SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index);
} else {
SetTownIndex(t, 0);