mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
fix(Core/Scripting): fix OnBeforeCreateInstanceScript hook (#19252)
- to me this hook should obviously provide an option to overwrite the InstanceScript pointer - this is e.g. beeing used by mod-eluna (but currently broken)
This commit is contained in:
@@ -3063,7 +3063,7 @@ void InstanceMap::CreateInstanceScript(bool load, std::string data, uint32 compl
|
||||
|
||||
bool isOtherAI = false;
|
||||
|
||||
sScriptMgr->OnBeforeCreateInstanceScript(this, instance_data, load, data, completedEncounterMask);
|
||||
sScriptMgr->OnBeforeCreateInstanceScript(this, &instance_data, load, data, completedEncounterMask);
|
||||
|
||||
if (instance_data)
|
||||
isOtherAI = true;
|
||||
|
||||
@@ -279,7 +279,7 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff)
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript* instanceData, bool load, std::string data, uint32 completedEncounterMask)
|
||||
void ScriptMgr::OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript** instanceData, bool load, std::string data, uint32 completedEncounterMask)
|
||||
{
|
||||
ExecuteScript<AllMapScript>([&](AllMapScript* script)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
* @param data Contains information about the instance save data
|
||||
* @param completedEncounterMask Contains information about the completed encouter mask
|
||||
*/
|
||||
virtual void OnBeforeCreateInstanceScript(InstanceMap* /*instanceMap*/, InstanceScript* /*instanceData*/, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) { }
|
||||
virtual void OnBeforeCreateInstanceScript(InstanceMap* /*instanceMap*/, InstanceScript** /*instanceData*/, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) { }
|
||||
|
||||
/**
|
||||
* @brief This hook called before destroy instance
|
||||
|
||||
@@ -572,7 +572,7 @@ public: /* AllGameobjectScript */
|
||||
void OnGameObjectSaveToDB(GameObject* go);
|
||||
|
||||
public: /* AllMapScript */
|
||||
void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript* instanceData, bool load, std::string data, uint32 completedEncounterMask);
|
||||
void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript** instanceData, bool load, std::string data, uint32 completedEncounterMask);
|
||||
void OnDestroyInstance(MapInstanced* mapInstanced, Map* map);
|
||||
|
||||
public: /* BGScript */
|
||||
|
||||
Reference in New Issue
Block a user