From c6d54411056da2dd563015c9f90c4c5c0863bc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sat, 3 Jun 2017 19:57:02 +0200 Subject: 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 --- src/map.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 41a1a246b..4b6e08f96 100644 --- a/src/map.h +++ b/src/map.h @@ -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); -- cgit v1.2.3