y < y_min || y > y_max)
continue;
- int height = getHeight();
- int max_y = nmax.Y;// + MAP_BLOCKSIZE - 1;
- if (y + 1 + height > max_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);
}
v3s16 pos(x, y, z);
- if (generate(mg->vm, &ps, max_y, pos))
+ if (generate(mg->vm, &ps, pos))
mg->gennotify.addEvent(GENNOTIFY_DECORATION, pos, id);
}
}
}
-size_t DecoSimple::generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p)
+size_t DecoSimple::generate(MMVManip *vm, PseudoRandom *pr, v3s16 p)
{
if (!canPlaceDecoration(vm, p))
return 0;
s16 height = (deco_height_max > 0) ?
pr->range(deco_height, deco_height_max) : deco_height;
- height = MYMIN(height, max_y - p.Y);
-
v3s16 em = vm->m_area.getExtent();
u32 vi = vm->m_area.index(p);
for (int i = 0; i < height; i++) {
///////////////////////////////////////////////////////////////////////////////
-size_t DecoSchematic::generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p)
+size_t DecoSchematic::generate(MMVManip *vm, PseudoRandom *pr, v3s16 p)
{
if (flags & DECO_PLACE_CENTER_X)
p.X -= (schematic->size.X + 1) / 2;
size_t placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
//size_t placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
- virtual size_t generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p) = 0;
+ virtual size_t generate(MMVManip *vm, PseudoRandom *pr, v3s16 p) = 0;
virtual int getHeight() = 0;
};
virtual void resolveNodeNames(NodeResolveInfo *nri);
bool canPlaceDecoration(MMVManip *vm, v3s16 p);
- virtual size_t generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p);
+ virtual size_t generate(MMVManip *vm, PseudoRandom *pr, v3s16 p);
virtual int getHeight();
};
Schematic *schematic;
std::string filename;
- virtual size_t generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p);
+ virtual size_t generate(MMVManip *vm, PseudoRandom *pr, v3s16 p);
virtual int getHeight();
};