1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Properly remove SAO when worldedges are overtaken (#5889)

* LuaEntitySAO: Remove beyond outermost mapchunk edges

Based on a commit by, and with help from, nerzhul.
Add 2 functions to class Mapgen:
A function to calculate actual mapgen edges, called from the Mapgen constructor.
A function called indirectly from content_sao.cpp per entity step to check SAO
position is within mapgen edges.

* Calculate borders from params not mapgen, which is not available everytime
This commit is contained in:
Loïc Blot 2017-06-03 19:57:02 +02:00 committed by GitHub
parent 72eec0f6f5
commit c6d5441105
5 changed files with 84 additions and 8 deletions

View file

@ -1378,6 +1378,11 @@ s16 ServerMap::getWaterLevel()
return getMapgenParams()->water_level;
}
bool ServerMap::saoPositionOverLimit(const v3f &p)
{
return getMapgenParams()->saoPosOverLimit(p);
}
bool ServerMap::blockpos_over_mapgen_limit(v3s16 p)
{
const s16 mapgen_limit_bp = rangelim(
@ -1838,9 +1843,6 @@ MapBlock *ServerMap::getBlockOrEmerge(v3s16 p3d)
return block;
}
void ServerMap::prepareBlock(MapBlock *block) {
}
// N.B. This requires no synchronization, since data will not be modified unless
// the VoxelManipulator being updated belongs to the same thread.
void ServerMap::updateVManip(v3s16 pos)