summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2007-02-14 20:17:11 +0000
committerDarkvater <Darkvater@openttd.org>2007-02-14 20:17:11 +0000
commit89172eb054efaffbfaf6b2428a668fe4c44d4176 (patch)
tree1b7058e63b76d121a1234f7e56a3def78c2477f3 /src
parent92faa8d80ef4763b7712ffe4caf3048da1c0ef1a (diff)
downloadopenttd-89172eb054efaffbfaf6b2428a668fe4c44d4176.tar.xz
(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.
Diffstat (limited to 'src')
-rw-r--r--src/oldloader.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 21c9fcd74..0bf625ab9 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -1491,16 +1491,28 @@ static bool LoadOldMain(LoadgameState *ls)
}
for (i = 0; i < OLD_MAP_SIZE; i ++) {
- if (IsTileType(i, 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 */
- if (_m[i].m4) /* Convert the presignals to our own format */
- _m[i].m4 = (_m[i].m4 >> 1) & 7;
- }
- /* 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 */
+ 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 */
+ if (_m[i].m4) /* Convert the presignals to our own format */
+ _m[i].m4 = (_m[i].m4 >> 1) & 7;
+ }
+ /* 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;
}
}