mirror of https://github.com/OpenTTD/OpenTTD
(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.
parent
001be23127
commit
ee2a851aab
|
@ -1181,8 +1181,8 @@ static void ConvertTownOwner()
|
||||||
for (TileIndex tile = 0; tile != MapSize(); tile++) {
|
for (TileIndex tile = 0; tile != MapSize(); tile++) {
|
||||||
switch (GetTileType(tile)) {
|
switch (GetTileType(tile)) {
|
||||||
case MP_ROAD:
|
case MP_ROAD:
|
||||||
if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HasBit(_m[tile].m4, 7)) {
|
if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HasBit(_m[tile].m3, 7)) {
|
||||||
_m[tile].m4 = OWNER_TOWN;
|
_m[tile].m3 = OWNER_TOWN;
|
||||||
}
|
}
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
|
@ -1565,7 +1565,7 @@ bool AfterLoadGame()
|
||||||
|
|
||||||
case MP_ROAD:
|
case MP_ROAD:
|
||||||
_m[t].m4 |= (_m[t].m2 << 4);
|
_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);
|
SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index);
|
||||||
} else {
|
} else {
|
||||||
SetTownIndex(t, 0);
|
SetTownIndex(t, 0);
|
||||||
|
|
Loading…
Reference in New Issue