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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user