From 32ba027fac44f050270a0ed76a66a4d8e6289de7 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 27 Nov 2024 12:12:20 +0300 Subject: [PATCH] replace getContentPacks with getAllContentPacks in global events emitting --- src/logic/scripting/scripting.cpp | 8 ++++---- src/logic/scripting/scripting_hud.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/logic/scripting/scripting.cpp b/src/logic/scripting/scripting.cpp index f15e36e3..9b43cf28 100644 --- a/src/logic/scripting/scripting.cpp +++ b/src/logic/scripting/scripting.cpp @@ -209,21 +209,21 @@ void scripting::on_world_load(LevelController* controller) { lua::call_nothrow(L, 0, 0); } - for (auto& pack : scripting::engine->getContentPacks()) { + for (auto& pack : scripting::engine->getAllContentPacks()) { lua::emit_event(L, pack.id + ":.worldopen"); } } void scripting::on_world_tick() { auto L = lua::get_main_state(); - for (auto& pack : scripting::engine->getContentPacks()) { + for (auto& pack : scripting::engine->getAllContentPacks()) { lua::emit_event(L, pack.id + ":.worldtick"); } } void scripting::on_world_save() { auto L = lua::get_main_state(); - for (auto& pack : scripting::engine->getContentPacks()) { + for (auto& pack : scripting::engine->getAllContentPacks()) { lua::emit_event(L, pack.id + ":.worldsave"); } if (lua::getglobal(L, "__vc_on_world_save")) { @@ -233,7 +233,7 @@ void scripting::on_world_save() { void scripting::on_world_quit() { auto L = lua::get_main_state(); - for (auto& pack : scripting::engine->getContentPacks()) { + for (auto& pack : scripting::engine->getAllContentPacks()) { lua::emit_event(L, pack.id + ":.worldquit"); } if (lua::getglobal(L, "__vc_on_world_quit")) { diff --git a/src/logic/scripting/scripting_hud.cpp b/src/logic/scripting/scripting_hud.cpp index 7adb5076..355c5335 100644 --- a/src/logic/scripting/scripting_hud.cpp +++ b/src/logic/scripting/scripting_hud.cpp @@ -42,7 +42,7 @@ void scripting::on_frontend_init(Hud* hud, WorldRenderer* renderer) { lua::call_nothrow(L, 0, 0); } - for (auto& pack : engine->getContentPacks()) { + for (auto& pack : engine->getAllContentPacks()) { lua::emit_event( lua::get_main_state(), pack.id + ":.hudopen", @@ -54,7 +54,7 @@ void scripting::on_frontend_init(Hud* hud, WorldRenderer* renderer) { } void scripting::on_frontend_render() { - for (auto& pack : engine->getContentPacks()) { + for (auto& pack : engine->getAllContentPacks()) { lua::emit_event( lua::get_main_state(), pack.id + ":.hudrender", @@ -64,7 +64,7 @@ void scripting::on_frontend_render() { } void scripting::on_frontend_close() { - for (auto& pack : engine->getContentPacks()) { + for (auto& pack : engine->getAllContentPacks()) { lua::emit_event( lua::get_main_state(), pack.id + ":.hudclose",