summaryrefslogtreecommitdiff
path: root/src/tgp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tgp.cpp')
-rw-r--r--src/tgp.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp
index 436870b41..a9f43bb77 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -14,6 +14,7 @@
#include "clear_map.h"
#include "void_map.h"
#include "genworld.h"
+#include "layer_func.h"
#include "core/random_func.hpp"
#include "landscape_type.h"
@@ -170,6 +171,8 @@ struct HeightMap
int total_size; //< height map total size
int size_x; //< MapSizeX()
int size_y; //< MapSizeY()
+ int map_x; //< MapSizeX()
+ int map_y; //< MapSizeY()
/**
* Height map accessor
@@ -307,8 +310,11 @@ static inline bool AllocHeightMap()
{
height_t *h;
- _height_map.size_x = MapSizeX();
- _height_map.size_y = MapSizeY();
+ _height_map.map_x = MapSizeX();
+ _height_map.map_y = MapSizeY();
+
+ _height_map.size_x = LayerSizeX();
+ _height_map.size_y = LayerSizeY();
/* Allocate memory block for height map row pointers */
_height_map.total_size = (_height_map.size_x + 1) * (_height_map.size_y + 1);
@@ -995,8 +1001,8 @@ void GenerateTerrainPerlin()
/* First make sure the tiles at the north border are void tiles if needed. */
if (_settings_game.construction.freeform_edges) {
- for (int y = 0; y < _height_map.size_y - 1; y++) MakeVoid(_height_map.size_x * y);
- for (int x = 0; x < _height_map.size_x; x++) MakeVoid(x);
+ for (int y = 0; y < _height_map.map_y - 1; y++) MakeVoid(_height_map.size_x * y);
+ for (int x = 0; x < _height_map.map_x; x++) MakeVoid(x);
}
int max_height = H2I(TGPGetMaxHeight());