From ccc3af128cb4b6213b8111115c570fe988d3523b Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Wed, 6 Jun 2018 12:53:59 +0200 Subject: CSM/SSM: Add on_mods_loaded callback (#7411) * CSM/SSM: Add on_mods_loaded callback --- src/script/cpp_api/s_client.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/script/cpp_api/s_client.cpp') diff --git a/src/script/cpp_api/s_client.cpp b/src/script/cpp_api/s_client.cpp index a8d8c2de4..7be4fc6a9 100644 --- a/src/script/cpp_api/s_client.cpp +++ b/src/script/cpp_api/s_client.cpp @@ -25,6 +25,17 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "common/c_content.h" #include "s_item.h" +void ScriptApiClient::on_mods_loaded() +{ + SCRIPTAPI_PRECHECKHEADER + + // Get registered shutdown hooks + lua_getglobal(L, "core"); + lua_getfield(L, -1, "registered_on_mods_loaded"); + // Call callbacks + runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); +} + void ScriptApiClient::on_shutdown() { SCRIPTAPI_PRECHECKHEADER -- cgit v1.2.3