From 9ac73f0bff07b17142da75fe5bd613a7227bb234 Mon Sep 17 00:00:00 2001 From: est31 Date: Mon, 7 Dec 2015 09:42:39 +0100 Subject: [PATCH] Fix threshold type Fix the type of the threshold value for mapgen. The commit a78dd7f2b6b0e1fefdbaa1ae21b722dd4459e4f4 "Fix spelling of noise_threshold" has changed it to be read as int, but it can have non-integral values too. Thanks to @kwolekr for pointing this out. --- src/script/lua_api/l_mapgen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index 516790fc..7aef0ded 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -954,9 +954,9 @@ int ModApiMapgen::l_register_ore(lua_State *L) warn_if_field_exists(L, index, "noise_threshhold", "Deprecated: new name is \"noise_threshold\"."); - int nthresh; - if (!getintfield(L, index, "noise_threshold", nthresh) && - !getintfield(L, index, "noise_threshhold", nthresh)) + float nthresh; + if (!getfloatfield(L, index, "noise_threshold", nthresh) && + !getfloatfield(L, index, "noise_threshhold", nthresh)) nthresh = 0; ore->nthresh = nthresh;