Enforce minimum stats size

This commit is contained in:
Wuzzy 2022-04-21 02:31:52 +02:00
parent 1e9b3c2d07
commit 888897e107

View File

@ -1725,6 +1725,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
show_error_formspec(player, S("Sorry, but Perlin Explorer doesnt support calculating statistics if the spread of any axis is larger than @1.", STATISTICS_MAX_SPREAD), false)
return
end
-- Enforce a minimum size as well to at least 1 million values are in the area
if dimensions == 2 and ssize < 1000 then
ssize = 1000
elseif dimensions == 3 and ssize < 100 then
ssize = 100
end
local start = -math.floor(ssize/2)
local pos = vector.new(start, start, start)