1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Add minetest.get_mapgen_edges (#12999)

This commit is contained in:
Jude Melton-Houghton 2022-12-03 10:40:46 -05:00 committed by GitHub
parent e84d259ec7
commit b3ffc4b327
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 103 additions and 17 deletions

View file

@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodedef.h"
#include "util/string.h"
#include "util/container.h"
#include <utility>
#define MAPGEN_DEFAULT MAPGEN_V7
#define MAPGEN_DEFAULT_NAME "v7"
@ -139,7 +140,6 @@ struct MapgenParams {
s32 getSpawnRangeMax();
private:
void calcMapgenEdges();
bool m_mapgen_edges_calculated = false;
};
@ -329,3 +329,7 @@ protected:
s16 dungeon_ymin;
s16 dungeon_ymax;
};
// Calculate exact edges of the outermost mapchunks that are within the set
// mapgen_limit. Returns the minimum and maximum edges in nodes in that order.
std::pair<s16, s16> get_mapgen_edges(s16 mapgen_limit, s16 chunksize);