aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2022-07-09 22:32:08 +0200
committerGitHub <noreply@github.com>2022-07-09 22:32:08 +0200
commit051181fa6ee00d8379e8a7dc7442b58342d4352b (patch)
tree58ad84f05310024b311c533684defdbeb5ee3e84 /src/mapgen/mapgen.cpp
parent7c261118e06c630ea9ad00f20d7005b8edc108dd (diff)
downloadminetest-051181fa6ee00d8379e8a7dc7442b58342d4352b.tar.gz
minetest-051181fa6ee00d8379e8a7dc7442b58342d4352b.tar.bz2
minetest-051181fa6ee00d8379e8a7dc7442b58342d4352b.zip
Enforce limits of settings that could cause buggy behaviour (#12450)
Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
Diffstat (limited to 'src/mapgen/mapgen.cpp')
-rw-r--r--src/mapgen/mapgen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index cca036b7b..99db50426 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -1038,6 +1038,8 @@ void MapgenParams::readParams(const Settings *settings)
settings->getS16NoEx("chunksize", chunksize);
settings->getFlagStrNoEx("mg_flags", flags, flagdesc_mapgen);
+ chunksize = rangelim(chunksize, 1, 10);
+
delete bparams;
bparams = BiomeManager::createBiomeParams(BIOMEGEN_ORIGINAL);
if (bparams) {