if (IsSavegameVersionBefore(196)) {
for (TileIndex t = 0; t < map_size; t++) {
/* To be able to restore the original owner of the canal under a dock,
* the watered part of the dock now stores that owner. Since this
* feature wasn't previously available, set the owner to OWNER_WATER,
* for as long as the water class was not WATER_CLASS_CANAL. */
if (IsDockTile(t) && HasTileWaterGround(t)) {
if (HasTileWaterClass(t) && GetWaterClass(t) != WATER_CLASS_CANAL) {
SetTileOwner(t, OWNER_WATER);
}
}
/* Industry completed bit is no longer set at m1 bit 7, but at m1 bit 4. */
if (IsTileType(t, MP_INDUSTRY) && HasBit(_m[t].m1, 7)) {
SetIndustryCompleted(t);
SB(_m[t].m1, 7, 1, 0);
}
/* When the Oil Rig industry was completed, m1 bit 7 would be set, and
* an Oil Rig station would inherit this bit. m1 bit 7 is being used to
* determine if a canal was built on a river now, and since this feature
* was previously unavailable, clear it. */
if (IsTileType(t, MP_STATION) && IsOilRig(t) && HasBit(_m[t].m1, 7)) {
SB(_m[t].m1, 7, 1, 0);
}
/* There was no real way to store canals owners before this version.
* Set the canal owner to be the same as the tile owner. */
if (IsWaterTile(t) && IsCanal(t)) {
SetCanalOwner(t, GetTileOwner(t));
}
if (IsShipDepotTile(t) && GetWaterClass(t) == WATER_CLASS_CANAL) {
SetCanalOwner(t, GetTileOwner(t));
}
}
_settings_game.construction.build_on_competitor_canal = 1;
}