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

@ -377,6 +377,8 @@ public:
*/
ServerMapSector *createSector(v2s16 p);
bool saoPositionOverLimit(const v3f &p);
/*
Blocks are generated by using these and makeBlock().
*/
@ -409,9 +411,6 @@ public:
*/
MapBlock *getBlockOrEmerge(v3s16 p3d);
// Carries out any initialization necessary before block is sent
void prepareBlock(MapBlock *block);
// Helper for placing objects on ground level
s16 findGroundLevel(v2s16 p2d);