From 7080b2dbe0e80979a702ffbbe4fec9d5bf40e051 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Fri, 19 Aug 2016 11:52:32 +0200 Subject: [PATCH] show more information if #20 happens M src/falling_snow.lua --- src/falling_snow.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/falling_snow.lua b/src/falling_snow.lua index 9ec6973..52f7bc7 100644 --- a/src/falling_snow.lua +++ b/src/falling_snow.lua @@ -106,6 +106,22 @@ local function cold_perlin_test(x, y) end v = minetest.get_perlin(112,3, 0.5, perlin_scale):get2d({x=x, y=y}) >= rarity + + local em = "" + if type(x) ~= "number" then + em = em.. "x no number but "..type(y).." " + elseif x%1 ~= 0 then + em = em.. "x no integer but "..x.." " + end + if type(y) ~= "number" then + em = em.. "y no number but "..type(y).." " + elseif y%1 ~= 0 then + em = em.. "y no integer but "..y.." " + end + if em ~= "" then + error(em) + end + if cold_perl_values[y] then cold_perl_values[y][x] = v end