diff --git a/src/lighting/Lighting.cpp b/src/lighting/Lighting.cpp index 5b5775d1..99cf1fcc 100644 --- a/src/lighting/Lighting.cpp +++ b/src/lighting/Lighting.cpp @@ -72,6 +72,7 @@ void Lighting::buildSkyLight(int cx, int cz){ y--; } if (chunk->lightmap.getS(x, y, z) != 15) { + solverS->add(gx,y+1,gz); for (; y >= 0; y--){ solverS->add(gx+1,y,gz); solverS->add(gx-1,y,gz); diff --git a/src/logic/BlocksController.cpp b/src/logic/BlocksController.cpp index 31286310..6cbb4aba 100644 --- a/src/logic/BlocksController.cpp +++ b/src/logic/BlocksController.cpp @@ -131,7 +131,7 @@ void BlocksController::randomTick(int tickid, int parts) { int index = z * w + x; if ((index + tickid) % parts != 0) continue; - auto chunk = chunks->chunks[index]; + auto& chunk = chunks->chunks[index]; if (chunk == nullptr || !chunk->isLighted()) continue; for (int s = 0; s < segments; s++) { diff --git a/src/logic/scripting/lua/LuaState.cpp b/src/logic/scripting/lua/LuaState.cpp index 32223c7b..902e9bf3 100644 --- a/src/logic/scripting/lua/LuaState.cpp +++ b/src/logic/scripting/lua/LuaState.cpp @@ -375,13 +375,6 @@ void lua::LuaState::openlib(const std::string& name, const luaL_Reg* libfuncs) { lua_setglobal(L, name.c_str()); } -const std::string lua::LuaState::storeAnonymous() { - auto funcId = uintptr_t(lua_topointer(L, lua_gettop(L))); - auto funcName = "F$"+util::mangleid(funcId); - lua_setglobal(L, funcName.c_str()); - return funcName; -} - std::shared_ptr lua::LuaState::createLambdaHandler() { auto ptr = reinterpret_cast(lua_topointer(L, -1)); auto name = util::mangleid(ptr); diff --git a/src/logic/scripting/lua/LuaState.hpp b/src/logic/scripting/lua/LuaState.hpp index 8b786562..5ab8e530 100644 --- a/src/logic/scripting/lua/LuaState.hpp +++ b/src/logic/scripting/lua/LuaState.hpp @@ -75,7 +75,6 @@ namespace lua { int createEnvironment(int parent); void removeEnvironment(int id); - const std::string storeAnonymous(); bool emit_event(const std::string& name, std::function args=[](auto*){return 0;}); void dumpStack(); lua_State* getLua() const;