aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-01-06 10:24:44 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2019-01-06 10:24:44 +0100
commita122ba0ef4af865d225adbe22a55b8001af04c61 (patch)
tree9e8e6097621396e4bab22e5aa21a70900a502878 /src/script/lua_api
parent70bf3439ab9f3cb826d76111552dcc38678fcf3d (diff)
downloadminetest-a122ba0ef4af865d225adbe22a55b8001af04c61.tar.gz
minetest-a122ba0ef4af865d225adbe22a55b8001af04c61.tar.bz2
minetest-a122ba0ef4af865d225adbe22a55b8001af04c61.zip
Fix various bugs (Anticheat, Lua helpers) (#8013)
* Fix various bugs (Anticheat, Lua helpers) Anticheat: Use camera position instead of player position for shoot line calculations Lua helpers: Increase 'i' to not overwrite earlier added table values * Remove lag compensation * * 1.5 for larger selection boxes
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp6
-rw-r--r--src/script/lua_api/l_mapgen.cpp3
-rw-r--r--src/script/lua_api/l_object.cpp3
3 files changed, 4 insertions, 8 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index f0f56098f..145ff0970 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -532,8 +532,7 @@ int ModApiMainMenu::l_get_content_info(lua_State *L)
int i = 1;
for (const auto &dep : spec.depends) {
lua_pushstring(L, dep.c_str());
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "depends");
@@ -542,8 +541,7 @@ int ModApiMainMenu::l_get_content_info(lua_State *L)
i = 1;
for (const auto &dep : spec.optdepends) {
lua_pushstring(L, dep.c_str());
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "optional_depends");
}
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index b8e52bd49..92ed4377e 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -1042,8 +1042,7 @@ int ModApiMapgen::l_get_gen_notify(lua_State *L)
int i = 1;
for (u32 gen_notify_on_deco_id : emerge->gen_notify_on_deco_ids) {
lua_pushnumber(L, gen_notify_on_deco_id);
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
return 2;
}
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index f077d42a0..e673778e9 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -1681,8 +1681,7 @@ int ObjectRef::l_get_sky(lua_State *L)
s16 i = 1;
for (const std::string &param : params) {
lua_pushlstring(L, param.c_str(), param.size());
- lua_rawseti(L, -2, i);
- i++;
+ lua_rawseti(L, -2, i++);
}
lua_pushboolean(L, clouds);
return 4;