diff options
author | paramat <mat.gregory@virginmedia.com> | 2015-07-08 20:01:29 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2015-07-08 22:44:10 +0100 |
commit | b51738177e2dae60153a825e200ea9cdeb1cec99 (patch) | |
tree | ae62777ef0e973fee087bb706ac51f018d9092a6 /src | |
parent | 39439cbd3dd4acce0ff897e3e277736251dde2a4 (diff) | |
download | minetest-b51738177e2dae60153a825e200ea9cdeb1cec99.tar.gz minetest-b51738177e2dae60153a825e200ea9cdeb1cec99.tar.bz2 minetest-b51738177e2dae60153a825e200ea9cdeb1cec99.zip |
Biome API decorations: 'spawnby' searches a 3D neighbourhood
The neighbours checked are the 8 nodes horizontally surrounding the decoration base
and the 8 nodes horizontally surrounding the ground node below the decoration
Diffstat (limited to 'src')
-rw-r--r-- | src/mg_decoration.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mg_decoration.cpp b/src/mg_decoration.cpp index f133788de..0d6693929 100644 --- a/src/mg_decoration.cpp +++ b/src/mg_decoration.cpp @@ -246,7 +246,7 @@ bool DecoSimple::canPlaceDecoration(MMVManip *vm, v3s16 p) return true; int nneighs = 0; - v3s16 dirs[8] = { + v3s16 dirs[16] = { v3s16( 0, 0, 1), v3s16( 0, 0, -1), v3s16( 1, 0, 0), @@ -254,7 +254,16 @@ bool DecoSimple::canPlaceDecoration(MMVManip *vm, v3s16 p) v3s16( 1, 0, 1), v3s16(-1, 0, 1), v3s16(-1, 0, -1), - v3s16( 1, 0, -1) + v3s16( 1, 0, -1), + + v3s16( 0, 1, 1), + v3s16( 0, 1, -1), + v3s16( 1, 1, 0), + v3s16(-1, 1, 0), + v3s16( 1, 1, 1), + v3s16(-1, 1, 1), + v3s16(-1, 1, -1), + v3s16( 1, 1, -1) }; // Check a Moore neighborhood if there are enough spawnby nodes |