aboutsummaryrefslogtreecommitdiff
path: root/src/script/common
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/common
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/common')
-rw-r--r--src/script/common/c_content.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 033549475..7e2f6772f 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -348,7 +348,7 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
u16 i = 1;
for (const std::string &texture : prop->textures) {
lua_pushlstring(L, texture.c_str(), texture.size());
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "textures");
@@ -356,7 +356,7 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
i = 1;
for (const video::SColor &color : prop->colors) {
push_ARGB8(L, color);
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "colors");
@@ -838,7 +838,7 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
u16 i = 1;
for (const std::string &it : c.connects_to) {
lua_pushlstring(L, it.c_str(), it.size());
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
lua_setfield(L, -2, "connects_to");
@@ -961,7 +961,7 @@ void push_box(lua_State *L, const std::vector<aabb3f> &box)
u8 i = 1;
for (const aabb3f &it : box) {
push_aabb3f(L, it);
- lua_rawseti(L, -2, i);
+ lua_rawseti(L, -2, i++);
}
}