From 888897e107c7b3f36ab73e039721990716987f90 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 21 Apr 2022 02:31:52 +0200 Subject: [PATCH] Enforce minimum stats size --- init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.lua b/init.lua index 5aee5e5..5c05e18 100644 --- a/init.lua +++ b/init.lua @@ -1725,6 +1725,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) show_error_formspec(player, S("Sorry, but Perlin Explorer doesn’t 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)