Scripts: hook after a .reload command

OnConfigLoad(true) fires part way through a config reload and nothing
fires after a table reload, so a module (bots) keeps stale copies of
config values or reloaded tables until restart. WorldScript::OnAfterReload
now runs once a .reload command (in game, console or remote) finished
without error, with the full command path such as "reload config" or
"reload creature_template". Nothing listens to it in the core, so no
behaviour change.
This commit is contained in:
Karrz1
2026-11-19 22:11:58 +00:00
parent 25fc7ca3a6
commit 2eced52e48
3 changed files with 24 additions and 0 deletions
+9
View File
@@ -1992,6 +1992,11 @@ bool ScriptMgr::CanCreateBattleground(uint32 battlemasterListId, uint8 bracketId
return allowed;
}
void ScriptMgr::OnAfterReload(std::string_view command)
{
FOREACH_SCRIPT(WorldScript)->OnAfterReload(command);
}
// Achievement
void ScriptMgr::OnAchievementCompleted(Player* player, AchievementEntry const* achievement)
{
@@ -2630,6 +2635,10 @@ bool WorldScript::CanCreateBattleground(uint32 /*battlemasterListId*/, uint8 /*b
return true;
}
void WorldScript::OnAfterReload(std::string_view /*command*/)
{
}
FormulaScript::FormulaScript(char const* name) noexcept
: ScriptObject(name)
{