1
0
Fork 0
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:
SmallJoker 2019-01-06 10:24:44 +01:00 committed by Loïc Blot
parent 70bf3439ab
commit a122ba0ef4
5 changed files with 15 additions and 16 deletions

View file

@ -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");
}

View file

@ -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;
}

View file

@ -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;