diff options
author | paramat <mat.gregory@virginmedia.com> | 2016-02-27 23:49:53 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2016-03-04 02:38:55 +0000 |
commit | 48a718e715710c9cb7edd6ad8e1cd7a0ed416908 (patch) | |
tree | 35560c6a53dc4a99f3cb851139bd06e5142877fd /src | |
parent | 1100a5d614c2eaf8e1c4f3adbc70b477e01a405c (diff) | |
download | minetest-48a718e715710c9cb7edd6ad8e1cd7a0ed416908.tar.gz minetest-48a718e715710c9cb7edd6ad8e1cd7a0ed416908.tar.bz2 minetest-48a718e715710c9cb7edd6ad8e1cd7a0ed416908.zip |
Decoration API: Allow force_placement of simple decorations
Diffstat (limited to 'src')
-rw-r--r-- | src/mg_decoration.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mg_decoration.cpp b/src/mg_decoration.cpp index 5959af259..8b6abb5d5 100644 --- a/src/mg_decoration.cpp +++ b/src/mg_decoration.cpp @@ -304,13 +304,16 @@ size_t DecoSimple::generate(MMVManip *vm, PcgRandom *pr, v3s16 p) s16 height = (deco_height_max > 0) ? pr->range(deco_height, deco_height_max) : deco_height; + bool force_placement = (flags & DECO_FORCE_PLACEMENT); + v3s16 em = vm->m_area.getExtent(); u32 vi = vm->m_area.index(p); for (int i = 0; i < height; i++) { vm->m_area.add_y(em, vi, 1); content_t c = vm->m_data[vi].getContent(); - if (c != CONTENT_AIR && c != CONTENT_IGNORE) + if (c != CONTENT_AIR && c != CONTENT_IGNORE && + !force_placement) break; vm->m_data[vi] = MapNode(c_place); |