mirror of
https://github.com/minetest/minetest.git
synced 2025-07-04 08:50:22 +02: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:
13
src/map.cpp
13
src/map.cpp
@ -1367,6 +1367,19 @@ s16 ServerMap::getWaterLevel()
|
||||
return getMapgenParams()->water_level;
|
||||
}
|
||||
|
||||
bool ServerMap::blockpos_over_mapgen_limit(v3s16 p)
|
||||
{
|
||||
const s16 mapgen_limit_bp = rangelim(
|
||||
getMapgenParams()->mapgen_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;
|
||||
}
|
||||
|
||||
bool ServerMap::initBlockMake(v3s16 blockpos, BlockMakeData *data)
|
||||
{
|
||||
s16 csize = getMapgenParams()->chunksize;
|
||||
|
Reference in New Issue
Block a user