summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2021-07-31 17:54:40 +0000
committerGitHub <noreply@github.com>2021-07-31 19:54:40 +0200
commite7cd4cfa25485610c05a906859e8365158a13f69 (patch)
treea7160e8a470fc3fe59e1b944cf0f5e9135d5d4e3 /src/settings.cpp
parent0257e7150f4c6dfe7b10802ada938143253c1773 (diff)
downloadminetest-e7cd4cfa25485610c05a906859e8365158a13f69.tar.gz
minetest-e7cd4cfa25485610c05a906859e8365158a13f69.tar.bz2
minetest-e7cd4cfa25485610c05a906859e8365158a13f69.zip
Fix /emergeblocks crashing in debug builds (#11461)
The reason for the bug was an u16 overflow, thus failing the assert. This only happened in Debug build but not in Release builds.
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 0a9424994..ba4629a6f 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -755,6 +755,15 @@ bool Settings::getS16NoEx(const std::string &name, s16 &val) const
}
}
+bool Settings::getU32NoEx(const std::string &name, u32 &val) const
+{
+ try {
+ val = getU32(name);
+ return true;
+ } catch (SettingNotFoundException &e) {
+ return false;
+ }
+}
bool Settings::getS32NoEx(const std::string &name, s32 &val) const
{