mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Map generation limit: Make per-world
The setting limits map generation but affects nothing else. Add 'mapgen_limit' to global mapgen parameters. Move 'blockpos_over_mapgen_limit()' to the only place it is called from: map.cpp. Allow teleportation to any part of the world even if over the set mapgen limit. Simplify the reading of this limit in mgvalleys. Remove the 'map_generation_limit' setting.
This commit is contained in:
parent
09f2cd0264
commit
ec0c4d33db
11 changed files with 45 additions and 47 deletions
|
@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "modifiedstate.h"
|
||||
#include "util/numeric.h" // getContainerPos
|
||||
#include "settings.h"
|
||||
#include "mapgen.h"
|
||||
|
||||
class Map;
|
||||
class NodeMetadataList;
|
||||
|
@ -689,19 +690,6 @@ inline bool blockpos_over_max_limit(v3s16 p)
|
|||
p.Z > max_limit_bp;
|
||||
}
|
||||
|
||||
inline bool blockpos_over_mapgen_limit(v3s16 p)
|
||||
{
|
||||
const s16 mapgen_limit_bp = rangelim(
|
||||
g_settings->getS16("map_generation_limit"), 0, MAX_MAP_GENERATION_LIMIT) /
|
||||
MAP_BLOCKSIZE;
|
||||
return p.X < -mapgen_limit_bp ||
|
||||
p.X > mapgen_limit_bp ||
|
||||
p.Y < -mapgen_limit_bp ||
|
||||
p.Y > mapgen_limit_bp ||
|
||||
p.Z < -mapgen_limit_bp ||
|
||||
p.Z > mapgen_limit_bp;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the position of the block where the node is located
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue