mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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
This commit is contained in:
parent
70bf3439ab
commit
a122ba0ef4
5 changed files with 15 additions and 16 deletions
|
@ -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++);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue