1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-15 19:42:10 +00:00

Add missing chunk size safety checks (#16502)

This commit is contained in:
sfan5 2025-09-22 18:46:22 +02:00 committed by GitHub
parent d5ddee6cbf
commit 4c29bf6923
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -132,6 +132,10 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
PcgRandom ps(blockseed + 53);
int carea_size = nmax.X - nmin.X + 1;
if (nmax.Z - nmin.Z + 1 != carea_size) {
// TODO: this is a stupid restriction, which we should lift
throw BaseException("Decoration::placeDeco requires a square area (XZ)");
}
// Divide area into parts
// If chunksize is changed it may no longer be divisable by sidelen