summaryrefslogtreecommitdiff
path: root/src/saveload/map_sl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/map_sl.cpp')
-rw-r--r--src/saveload/map_sl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/saveload/map_sl.cpp b/src/saveload/map_sl.cpp
index 7088a4406..c54e54e92 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"
@@ -18,10 +19,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()
};
@@ -29,13 +32,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()