Skip to content

Commit

Permalink
Fix threshold type
Browse files Browse the repository at this point in the history
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 51e8c2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/script/lua_api/l_mapgen.cpp
Expand Up @@ -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;

Expand Down

1 comment on commit 51e8c2b

@BlockMen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.