1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.
This commit is contained in:
Wuzzy 2021-07-31 17:54:40 +00:00 committed by GitHub
parent 0257e7150f
commit e7cd4cfa25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 24 deletions

View file

@ -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
{