check y limits early

This commit is contained in:
Erich Schubert 2025-03-01 17:15:02 +01:00 committed by sfan5
parent 08fad862aa
commit 6e995972bb

View file

@ -126,6 +126,10 @@ bool Decoration::canPlaceDecoration(MMVManip *vm, v3s16 p)
void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
{
// Skip if y ranges do not overlap
if (nmax.Y < y_min || y_max < nmin.Y)
return;
PcgRandom ps(blockseed + 53);
int carea_size = nmax.X - nmin.X + 1;