Placing a structure that extends into mapblocks that extend past
map_gen_limit causes a crash. For example a sapling growing at the
world edge which adds leaves beyond the edge, or placing a structure
using the lua voxelmanip, or placing a schematic or l-system tree.
Do not run the 'load_if_inexistent' block of code if the mapblock
is over limit, this also marks the mapblock with the flag
VMANIP_BLOCK_DATA_INEXIST which later prevents blitting back those
mapblocks.
This fix therefore uses existing functionality by having the same
effect as the 'load_if_inexistent' bool being false.
if(block_data_inexistent)
{
- if (load_if_inexistent) {
+ if (load_if_inexistent && !blockpos_over_limit(p)) {
ServerMap *svrmap = (ServerMap *)m_map;
block = svrmap->emergeBlock(p, false);
if (block == NULL)