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:
parent
af3f696423
commit
a99e985674
3 changed files with 15 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue