Skip to content
Permalink
Browse files

Fix threshold type

Fix the type of the threshold value for mapgen.
The commit

a78dd7f "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.
  • Loading branch information
est31 committed Dec 7, 2015
1 parent 9a5a538 commit 51e8c2b27786c050f0271eeeaed5eea17d62f0a0
Showing with 3 additions and 3 deletions.
  1. +3 −3 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;

1 comment on commit 51e8c2b

@BlockMen

This comment has been minimized.

Copy link
Contributor

@BlockMen BlockMen commented on 51e8c2b Dec 7, 2015

Oh, sry. Interesting that 3 ppl didn't notice :\

Please sign in to comment.