mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
CSM/SSM: Add on_mods_loaded callback (#7411)
* CSM/SSM: Add on_mods_loaded callback
This commit is contained in:
parent
a2de439a91
commit
ccc3af128c
12 changed files with 50 additions and 0 deletions
|
@ -147,6 +147,17 @@ bool ScriptApiServer::on_chat_message(const std::string &name,
|
|||
return ate;
|
||||
}
|
||||
|
||||
void ScriptApiServer::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 ScriptApiServer::on_shutdown()
|
||||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue