X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmg_decoration.cpp;h=127915b51aecd2688ceece503f2d4fff17c89914;hb=78ff5c193683fc643fbec85dc398da91d91a9e44;hp=8b6abb5d5598da883ef654478ed89884bf6d97d6;hpb=48a718e715710c9cb7edd6ad8e1cd7a0ed416908;p=dragonfireclient.git diff --git a/src/mg_decoration.cpp b/src/mg_decoration.cpp index 8b6abb5d5..127915b51 100644 --- a/src/mg_decoration.cpp +++ b/src/mg_decoration.cpp @@ -145,7 +145,7 @@ size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) y < y_min || y > y_max) continue; - if (y + getHeight() >= mg->vm->m_area.MaxEdge.Y) { + if (y + getHeight() > mg->vm->m_area.MaxEdge.Y) { continue; #if 0 printf("Decoration at (%d %d %d) cut off\n", x, y, z); @@ -156,7 +156,7 @@ size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) } if (mg->biomemap) { - std::set::iterator iter; + UNORDERED_SET::iterator iter; if (!biomes.empty()) { iter = biomes.find(mg->biomemap[mapindex]); @@ -370,5 +370,9 @@ size_t DecoSchematic::generate(MMVManip *vm, PcgRandom *pr, v3s16 p) int DecoSchematic::getHeight() { - return schematic->size.Y; + // Account for a schematic being sunk into the ground by flag. + // When placed normally account for how a schematic is placed + // sunk 1 node into the ground. + return (flags & DECO_PLACE_CENTER_Y) ? + (schematic->size.Y - 1) / 2 : schematic->size.Y - 1; }