1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

CSM/SSM: Add on_mods_loaded callback (#7411)

* CSM/SSM: Add on_mods_loaded callback
This commit is contained in:
Loïc Blot 2018-06-06 12:53:59 +02:00 committed by GitHub
parent a2de439a91
commit ccc3af128c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 50 additions and 0 deletions

View file

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