(svn r8738) -Fix: TTDP games have all tiles touching the water marked as MP_WATER, we do not (tiles with one corner, or steep tiles), so check and fix these tiles.

This commit is contained in:
Darkvater 2007-02-14 20:17:11 +00:00
parent c8fb4ddf57
commit 12868eeb97

View File

@ -1491,7 +1491,8 @@ static bool LoadOldMain(LoadgameState *ls)
}
for (i = 0; i < OLD_MAP_SIZE; i ++) {
if (IsTileType(i, MP_RAILWAY)) {
switch (GetTileType(i)) {
case MP_RAILWAY:
/* We save presignals different from TTDPatch, convert them */
if (GetRailTileType(i) == RAIL_TILE_SIGNALS) {
/* This byte is always zero in TTD for this type of tile */
@ -1501,6 +1502,17 @@ static bool LoadOldMain(LoadgameState *ls)
/* TTDPatch stores PBS things in L6 and all elsewhere; so we'll just
* clear it for ourselves and let OTTD's rebuild PBS itself */
_m[i].m4 &= 0xF; /* Only keep the lower four bits; upper four is PBS */
break;
case MP_WATER:
/* TTDPatch has all tiles touching water as coast (water)-type, we don't.
* This is only true from a certain TTDP version, but there is no harm
* in checking all the time */
Slope s = GetTileSlope(i, NULL);
if (s == SLOPE_ENW || s == SLOPE_NWS || s == SLOPE_SEN || s == SLOPE_WSE || IsSteepSlope(s)) {
SetTileType(i, MP_CLEAR);
SetTileOwner(i, OWNER_NONE);
}
break;
}
}