aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2012-10-28 18:31:14 -0300
committerPerttu Ahola <celeron55@gmail.com>2013-01-21 21:41:09 +0200
commit9b3287b86512a4f4a19cbe036b218e684aa54479 (patch)
tree5693fd60c277e8fbfec0c337880de1d75f241d04
parent14657bd29a0b6783fc97029769af6d48a05d473d (diff)
downloadminetest-9b3287b86512a4f4a19cbe036b218e684aa54479.tar.gz
minetest-9b3287b86512a4f4a19cbe036b218e684aa54479.tar.bz2
minetest-9b3287b86512a4f4a19cbe036b218e684aa54479.zip
stop MSVC++ from generating dumb warnings
-rw-r--r--src/scriptapi.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index 8e4a43266..959885d32 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -5591,16 +5591,16 @@ static void scriptapi_run_callbacks(lua_State *L, int nargs,
lua_replace(L, rv);
else if(mode == RUN_CALLBACKS_MODE_AND ||
mode == RUN_CALLBACKS_MODE_AND_SC){
- if(lua_toboolean(L, rv) == true &&
- lua_toboolean(L, -1) == false)
+ if((bool)lua_toboolean(L, rv) == true &&
+ (bool)lua_toboolean(L, -1) == false)
lua_replace(L, rv);
else
lua_pop(L, 1);
}
else if(mode == RUN_CALLBACKS_MODE_OR ||
mode == RUN_CALLBACKS_MODE_OR_SC){
- if(lua_toboolean(L, rv) == false &&
- lua_toboolean(L, -1) == true)
+ if((bool)lua_toboolean(L, rv) == false &&
+ (bool)lua_toboolean(L, -1) == true)
lua_replace(L, rv);
else
lua_pop(L, 1);
@@ -5611,10 +5611,10 @@ static void scriptapi_run_callbacks(lua_State *L, int nargs,
// Handle short circuit modes
if(mode == RUN_CALLBACKS_MODE_AND_SC &&
- lua_toboolean(L, rv) == false)
+ (bool)lua_toboolean(L, rv) == false)
break;
else if(mode == RUN_CALLBACKS_MODE_OR_SC &&
- lua_toboolean(L, rv) == true)
+ (bool)lua_toboolean(L, rv) == true)
break;
// value removed, keep key for next iteration
@@ -6095,7 +6095,7 @@ bool scriptapi_node_on_timer(lua_State *L, v3s16 p, MapNode node, f32 dtime)
lua_pushnumber(L,dtime);
if(lua_pcall(L, 2, 1, 0))
script_error(L, "error: %s", lua_tostring(L, -1));
- if(lua_isboolean(L,-1) && lua_toboolean(L,-1) == true)
+ if((bool)lua_isboolean(L,-1) && (bool)lua_toboolean(L,-1) == true)
return true;
return false;