aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_noise.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2018-06-04 22:38:07 +0200
committerGitHub <noreply@github.com>2018-06-04 22:38:07 +0200
commit180e551c56ec7229a15bfd9ce7339bc9881e1df6 (patch)
tree6425b85a713a8805ce42d5987cb8609c5aeb3d5b /src/script/lua_api/l_noise.cpp
parent86b19f284990304f5c8322040f277138333a3697 (diff)
downloadminetest-180e551c56ec7229a15bfd9ce7339bc9881e1df6.tar.gz
minetest-180e551c56ec7229a15bfd9ce7339bc9881e1df6.tar.bz2
minetest-180e551c56ec7229a15bfd9ce7339bc9881e1df6.zip
Modernize lua read (part 1): C++ templating insurance (#7394)
* Modernize lua read (part 1): C++ templating assurance Implement the float reader
Diffstat (limited to 'src/script/lua_api/l_noise.cpp')
-rw-r--r--src/script/lua_api/l_noise.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/lua_api/l_noise.cpp b/src/script/lua_api/l_noise.cpp
index 85e908356..d382ca3bd 100644
--- a/src/script/lua_api/l_noise.cpp
+++ b/src/script/lua_api/l_noise.cpp
@@ -69,8 +69,8 @@ int LuaPerlinNoise::create_object(lua_State *L)
} else {
params.seed = luaL_checkint(L, 1);
params.octaves = luaL_checkint(L, 2);
- params.persist = luaL_checknumber(L, 3);
- params.spread = v3f(1, 1, 1) * luaL_checknumber(L, 4);
+ params.persist = readParam<float>(L, 3);
+ params.spread = v3f(1, 1, 1) * readParam<float>(L, 4);
}
LuaPerlinNoise *o = new LuaPerlinNoise(&params);