(svn r13838) -Codechange: Make industry tiles aware of WaterClasses.

This commit is contained in:
frosch
2008-07-26 16:14:10 +00:00
parent ea7ed286a6
commit 16c80d031c
12 changed files with 110 additions and 36 deletions

View File

@@ -2340,8 +2340,8 @@ bool AfterLoadGame()
for (TileIndex t = 0; t < map_size; t++) {
if (GetTileSlope(t, NULL) != SLOPE_FLAT) continue;
if (IsTileType(t, MP_WATER) && IsLock(t)) SetWaterClassDependingOnSurroundings(t);
if (IsTileType(t, MP_STATION) && (IsDock(t) || IsBuoy(t))) SetWaterClassDependingOnSurroundings(t);
if (IsTileType(t, MP_WATER) && IsLock(t)) SetWaterClassDependingOnSurroundings(t, false);
if (IsTileType(t, MP_STATION) && (IsDock(t) || IsBuoy(t))) SetWaterClassDependingOnSurroundings(t, false);
}
}
@@ -2438,6 +2438,22 @@ bool AfterLoadGame()
}
}
if (CheckSavegameVersion(99)) {
/* Set newly introduced WaterClass of industry tiles */
for (TileIndex t = 0; t < map_size; t++) {
if (IsTileType(t, MP_STATION) && IsOilRig(t)) {
SetWaterClassDependingOnSurroundings(t, true);
}
if (IsTileType(t, MP_INDUSTRY)) {
if ((GetIndustrySpec(GetIndustryType(t))->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0) {
SetWaterClassDependingOnSurroundings(t, true);
} else {
SetWaterClass(t, WATER_CLASS_INVALID);
}
}
}
}
GamelogPrintDebug(1);
return InitializeWindowsAndCaches();