diff options
author | Erich Eckner <git@eckner.net> | 2018-10-30 11:13:12 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-11-16 19:11:46 +0100 |
commit | 5430113f4a842e519d2661a490022dcdf86f5247 (patch) | |
tree | 9368bef97133cea28eae5fc2161a4fdfd61dae27 /src/saveload | |
parent | 278a705bbbd378a4c05a795b42028ba440a8bd49 (diff) | |
download | openttd-5430113f4a842e519d2661a490022dcdf86f5247.tar.xz |
underground patch applied
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/map_sl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/saveload/map_sl.cpp b/src/saveload/map_sl.cpp index 693ddb7ce..e2e9f4877 100644 --- a/src/saveload/map_sl.cpp +++ b/src/saveload/map_sl.cpp @@ -11,6 +11,7 @@ #include "../stdafx.h" #include "../map_func.h" +#include "../layer_func.h" #include "../core/bitmath_func.hpp" #include "../fios.h" @@ -20,10 +21,12 @@ static uint32 _map_dim_x; static uint32 _map_dim_y; +static uint32 _layer_count; static const SaveLoadGlobVarList _map_dimensions[] = { SLEG_CONDVAR(_map_dim_x, SLE_UINT32, 6, SL_MAX_VERSION), SLEG_CONDVAR(_map_dim_y, SLE_UINT32, 6, SL_MAX_VERSION), + SLEG_CONDVAR(_layer_count, SLE_UINT32, 6, SL_MAX_VERSION), SLEG_END() }; @@ -31,13 +34,14 @@ static void Save_MAPS() { _map_dim_x = MapSizeX(); _map_dim_y = MapSizeY(); + _layer_count = LayerCount(); SlGlobList(_map_dimensions); } static void Load_MAPS() { SlGlobList(_map_dimensions); - AllocateMap(_map_dim_x, _map_dim_y); + AllocateMap(_map_dim_x, _map_dim_y/_layer_count, _layer_count); } static void Check_MAPS() |