aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-12-07 09:42:39 +0100
committerest31 <MTest31@outlook.com>2015-12-07 09:57:45 +0100
commit51e8c2b27786c050f0271eeeaed5eea17d62f0a0 (patch)
treee56eeb4468685fc8533cc2ae77ca138603db1a96 /src/script/lua_api
parent9a5a538e8d1981fb3c2dd69ca3d37e4f9c426cf5 (diff)
downloadminetest-51e8c2b27786c050f0271eeeaed5eea17d62f0a0.tar.gz
minetest-51e8c2b27786c050f0271eeeaed5eea17d62f0a0.tar.bz2
minetest-51e8c2b27786c050f0271eeeaed5eea17d62f0a0.zip
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.
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mapgen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index b29fd96ca..fb839176b 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -951,9 +951,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;