fix console focus on open

This commit is contained in:
MihailRis
2024-11-01 16:20:58 +03:00
parent 536045ddc4
commit ac6084f904
5 changed files with 13 additions and 12 deletions
+8 -5
View File
@@ -187,7 +187,15 @@ void scripting::on_world_quit() {
for (auto& pack : scripting::engine->getContentPacks()) {
lua::emit_event(L, pack.id + ":.worldquit");
}
scripting::level = nullptr;
scripting::content = nullptr;
scripting::indices = nullptr;
scripting::blocks = nullptr;
scripting::controller = nullptr;
}
void scripting::cleanup() {
auto L = lua::get_main_state();
lua::getglobal(L, "pack");
for (auto& pack : scripting::engine->getAllContentPacks()) {
lua::getfield(L, "unload");
@@ -199,11 +207,6 @@ void scripting::on_world_quit() {
if (lua::getglobal(L, "__scripts_cleanup")) {
lua::call_nothrow(L, 0);
}
scripting::level = nullptr;
scripting::content = nullptr;
scripting::indices = nullptr;
scripting::blocks = nullptr;
scripting::controller = nullptr;
}
void scripting::on_blocks_tick(const Block& block, int tps) {