mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-13 17:49:10 +00:00
Fix #7400: Water class for tree tiles was not converted for old saves preventing industry creation.
As the information is always available from the tree ground type, unconditionally update the map array for tree tiles.
This commit is contained in:
@@ -3080,6 +3080,13 @@ bool AfterLoadGame()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Update water class for trees for all current savegame versions. */
|
||||||
|
for (TileIndex t = 0; t < map_size; t++) {
|
||||||
|
if (IsTileType(t, MP_TREES)) SetWaterClass(t, GetTreeGround(t) == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Station acceptance is some kind of cache */
|
/* Station acceptance is some kind of cache */
|
||||||
if (IsSavegameVersionBefore(SLV_127)) {
|
if (IsSavegameVersionBefore(SLV_127)) {
|
||||||
Station *st;
|
Station *st;
|
||||||
|
@@ -277,6 +277,7 @@ static inline void MakeTree(TileIndex t, TreeType type, uint count, uint growth,
|
|||||||
{
|
{
|
||||||
SetTileType(t, MP_TREES);
|
SetTileType(t, MP_TREES);
|
||||||
SetTileOwner(t, OWNER_NONE);
|
SetTileOwner(t, OWNER_NONE);
|
||||||
|
SetWaterClass(t, ground == TREE_GROUND_SHORE ? WATER_CLASS_SEA : WATER_CLASS_INVALID);
|
||||||
_m[t].m2 = ground << 6 | density << 4 | 0;
|
_m[t].m2 = ground << 6 | density << 4 | 0;
|
||||||
_m[t].m3 = type;
|
_m[t].m3 = type;
|
||||||
_m[t].m4 = 0 << 5 | 0 << 2;
|
_m[t].m4 = 0 << 5 | 0 << 2;
|
||||||
|
Reference in New Issue
Block a user