1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Centralize arbitrary area volume limit and raise it (#15696)

This commit is contained in:
sfan5 2025-01-23 12:18:20 +01:00 committed by GitHub
parent af3f696423
commit a99e985674
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 17 deletions

View file

@ -847,9 +847,8 @@ int ModApiEnv::l_find_node_near(lua_State *L)
void ModApiEnvBase::checkArea(v3s16 &minp, v3s16 &maxp)
{
auto volume = VoxelArea(minp, maxp).getVolume();
// Volume limit equal to 8 default mapchunks, (80 * 2) ^ 3 = 4,096,000
if (volume > 4096000) {
throw LuaError("Area volume exceeds allowed value of 4096000");
if (volume > MAX_WORKING_VOLUME) {
throw LuaError("Area volume exceeds allowed value of " + std::to_string(MAX_WORKING_VOLUME));
}
// Clamp to map range to avoid problems