Mercurial > hg > openttd
comparison src/saveload/afterload.cpp @ 14171:72a4eae02e7d draft
(svn r18719) -Feature: don't delete the rough/rocky status of a tile when it's covered by snow, this allows rocky tiles under snow if you have a variable snowline
author | yexo <yexo@openttd.org> |
---|---|
date | Mon, 04 Jan 2010 18:33:43 +0000 |
parents | bb2258bdc43d |
children | 41b2e7bf03da |
comparison
equal
deleted
inserted
replaced
14170:31fbd9c51a5f | 14171:72a4eae02e7d |
---|---|
118 has_water |= (GetRailGroundType(neighbour) == RAIL_GROUND_WATER); | 118 has_water |= (GetRailGroundType(neighbour) == RAIL_GROUND_WATER); |
119 break; | 119 break; |
120 | 120 |
121 case MP_TREES: | 121 case MP_TREES: |
122 /* trees on shore */ | 122 /* trees on shore */ |
123 has_water |= (GetTreeGround(neighbour) == TREE_GROUND_SHORE); | 123 has_water |= (GB(_m[neighbour].m2, 4, 2) == TREE_GROUND_SHORE); |
124 break; | 124 break; |
125 | 125 |
126 default: break; | 126 default: break; |
127 } | 127 } |
128 } | 128 } |
1435 * land used to have zero density, now they have full density. Therefore, | 1435 * land used to have zero density, now they have full density. Therefore, |
1436 * make all grassy/rough land trees have a density of 3. */ | 1436 * make all grassy/rough land trees have a density of 3. */ |
1437 if (CheckSavegameVersion(81)) { | 1437 if (CheckSavegameVersion(81)) { |
1438 for (TileIndex t = 0; t < map_size; t++) { | 1438 for (TileIndex t = 0; t < map_size; t++) { |
1439 if (GetTileType(t) == MP_TREES) { | 1439 if (GetTileType(t) == MP_TREES) { |
1440 TreeGround groundType = GetTreeGround(t); | 1440 TreeGround groundType = (TreeGround)GB(_m[t].m2, 4, 2); |
1441 if (groundType != TREE_GROUND_SNOW_DESERT) SetTreeGroundDensity(t, groundType, 3); | 1441 if (groundType != TREE_GROUND_SNOW_DESERT) SB(_m[t].m2, 6, 2, 3); |
1442 } | 1442 } |
1443 } | 1443 } |
1444 } | 1444 } |
1445 | 1445 |
1446 | 1446 |
1974 FOR_ALL_TRAINS(t) { | 1974 FOR_ALL_TRAINS(t) { |
1975 t->force_proceed = min<byte>(t->force_proceed, 1); | 1975 t->force_proceed = min<byte>(t->force_proceed, 1); |
1976 } | 1976 } |
1977 } | 1977 } |
1978 | 1978 |
1979 /* The bits for the tree ground and tree density have | |
1980 * been swapped (m2 bits 7..6 and 5..4. */ | |
1981 if (CheckSavegameVersion(135)) { | |
1982 for (TileIndex t = 0; t < map_size; t++) { | |
1983 if (IsTileType(t, MP_CLEAR)) { | |
1984 if (GetRawClearGround(t) == CLEAR_SNOW) { | |
1985 SetClearGroundDensity(t, CLEAR_GRASS, GetClearDensity(t)); | |
1986 SetBit(_m[t].m3, 4); | |
1987 } else { | |
1988 ClrBit(_m[t].m3, 4); | |
1989 } | |
1990 } | |
1991 if (IsTileType(t, MP_TREES)) { | |
1992 uint density = GB(_m[t].m2, 6, 2); | |
1993 uint ground = GB(_m[t].m2, 4, 2); | |
1994 uint counter = GB(_m[t].m2, 0, 4); | |
1995 _m[t].m2 = ground << 6 | density << 4 | counter; | |
1996 } | |
1997 } | |
1998 } | |
1999 | |
1979 /* Road stops is 'only' updating some caches */ | 2000 /* Road stops is 'only' updating some caches */ |
1980 AfterLoadRoadStops(); | 2001 AfterLoadRoadStops(); |
1981 AfterLoadLabelMaps(); | 2002 AfterLoadLabelMaps(); |
1982 | 2003 |
1983 GamelogPrintDebug(1); | 2004 GamelogPrintDebug(1); |