mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
check y limits early
This commit is contained in:
parent
08fad862aa
commit
6e995972bb
1 changed files with 4 additions and 0 deletions
|
@ -126,6 +126,10 @@ bool Decoration::canPlaceDecoration(MMVManip *vm, v3s16 p)
|
||||||
|
|
||||||
void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
|
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);
|
PcgRandom ps(blockseed + 53);
|
||||||
int carea_size = nmax.X - nmin.X + 1;
|
int carea_size = nmax.X - nmin.X + 1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue