summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_env.cpp
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2015-03-06 20:21:51 +1000
committerCraig Robbins <kde.psych@gmail.com>2015-03-07 22:41:47 +1000
commitced6d20295a8263757d57c02a07ffcb66688a163 (patch)
treea44527357c1ffccb88bf479686735aef168d15c1 /src/script/lua_api/l_env.cpp
parenta603a767877b94b4d3bc4d3de8d762fbc56a583d (diff)
downloadminetest-ced6d20295a8263757d57c02a07ffcb66688a163.tar.gz
minetest-ced6d20295a8263757d57c02a07ffcb66688a163.tar.bz2
minetest-ced6d20295a8263757d57c02a07ffcb66688a163.zip
For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r--src/script/lua_api/l_env.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index 1f1d8bffa..840c34595 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -49,7 +49,7 @@ void LuaABM::trigger(ServerEnvironment *env, v3s16 p, MapNode n,
scriptIface->realityCheck();
lua_State *L = scriptIface->getStack();
- assert(lua_checkstack(L, 20));
+ sanity_check(lua_checkstack(L, 20));
StackUnroller stack_unroller(L);
lua_pushcfunction(L, script_error_handler);
@@ -65,7 +65,7 @@ void LuaABM::trigger(ServerEnvironment *env, v3s16 p, MapNode n,
lua_pushnumber(L, m_id);
lua_gettable(L, -2);
if(lua_isnil(L, -1))
- assert(0);
+ FATAL_ERROR("");
lua_remove(L, -2); // Remove registered_abms
// Call action
@@ -459,7 +459,7 @@ int ModApiEnvMod::l_set_timeofday(lua_State *L)
// Do it
float timeofday_f = luaL_checknumber(L, 1);
- assert(timeofday_f >= 0.0 && timeofday_f <= 1.0);
+ sanity_check(timeofday_f >= 0.0 && timeofday_f <= 1.0);
int timeofday_mh = (int)(timeofday_f * 24000.0);
// This should be set directly in the environment but currently
// such changes aren't immediately sent to the clients, so call