From 3d4244cc75b7e75565476032851fbd30d5cd9306 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 19 Apr 2015 21:42:40 -0400 Subject: Add 'persistence' alias for Lua noiseparams and validate more vector parameters --- src/script/lua_api/l_noise.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/script/lua_api') diff --git a/src/script/lua_api/l_noise.cpp b/src/script/lua_api/l_noise.cpp index bf3dca589..84f8875b8 100644 --- a/src/script/lua_api/l_noise.cpp +++ b/src/script/lua_api/l_noise.cpp @@ -43,7 +43,7 @@ int LuaPerlinNoise::l_get2d(lua_State *L) { NO_MAP_LOCK_REQUIRED; LuaPerlinNoise *o = checkobject(L, 1); - v2f p = read_v2f(L, 2); + v2f p = check_v2f(L, 2); lua_Number val = NoisePerlin2D(&o->np, p.X, p.Y, 0); lua_pushnumber(L, val); return 1; @@ -54,7 +54,7 @@ int LuaPerlinNoise::l_get3d(lua_State *L) { NO_MAP_LOCK_REQUIRED; LuaPerlinNoise *o = checkobject(L, 1); - v3f p = read_v3f(L, 2); + v3f p = check_v3f(L, 2); lua_Number val = NoisePerlin3D(&o->np, p.X, p.Y, p.Z, 0); lua_pushnumber(L, val); return 1; @@ -168,7 +168,7 @@ int LuaPerlinNoiseMap::l_get2dMap(lua_State *L) size_t i = 0; LuaPerlinNoiseMap *o = checkobject(L, 1); - v2f p = read_v2f(L, 2); + v2f p = check_v2f(L, 2); Noise *n = o->noise; n->perlinMap2D(p.X, p.Y); @@ -191,7 +191,7 @@ int LuaPerlinNoiseMap::l_get2dMap_flat(lua_State *L) NO_MAP_LOCK_REQUIRED; LuaPerlinNoiseMap *o = checkobject(L, 1); - v2f p = read_v2f(L, 2); + v2f p = check_v2f(L, 2); Noise *n = o->noise; n->perlinMap2D(p.X, p.Y); @@ -213,7 +213,7 @@ int LuaPerlinNoiseMap::l_get3dMap(lua_State *L) size_t i = 0; LuaPerlinNoiseMap *o = checkobject(L, 1); - v3f p = read_v3f(L, 2); + v3f p = check_v3f(L, 2); if (!o->m_is3d) return 0; @@ -243,7 +243,7 @@ int LuaPerlinNoiseMap::l_get3dMap_flat(lua_State *L) NO_MAP_LOCK_REQUIRED; LuaPerlinNoiseMap *o = checkobject(L, 1); - v3f p = read_v3f(L, 2); + v3f p = check_v3f(L, 2); if (!o->m_is3d) return 0; -- cgit v1.2.3