Skip to content

Commit 111e7e1

Browse files
committedFeb 18, 2017
Voxelmanip: Do not emerge or blit to blocks over map gen limit
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.
1 parent d0a6cac commit 111e7e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/map.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3161,7 +3161,7 @@ void MMVManip::initialEmerge(v3s16 blockpos_min, v3s16 blockpos_max,
31613161
if(block_data_inexistent)
31623162
{
31633163

3164-
if (load_if_inexistent) {
3164+
if (load_if_inexistent && !blockpos_over_limit(p)) {
31653165
ServerMap *svrmap = (ServerMap *)m_map;
31663166
block = svrmap->emergeBlock(p, false);
31673167
if (block == NULL)

0 commit comments

Comments
 (0)
Please sign in to comment.