From e00386fa5bb45f0e62edc3419e9d74ee26c7a4d3 Mon Sep 17 00:00:00 2001 From: sudlud Date: Wed, 3 Jul 2024 23:01:03 +0200 Subject: [PATCH] fix OnBeforeCreateInstanceScript() hook (#182) --- src/ElunaLuaEngine_SC.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ElunaLuaEngine_SC.cpp b/src/ElunaLuaEngine_SC.cpp index 40b93fbf99..520239f2ae 100644 --- a/src/ElunaLuaEngine_SC.cpp +++ b/src/ElunaLuaEngine_SC.cpp @@ -237,9 +237,10 @@ class Eluna_AllMapScript : public AllMapScript public: Eluna_AllMapScript() : AllMapScript("Eluna_AllMapScript") { } - void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript* instanceData, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) override + void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript** instanceData, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) override { - instanceData = sEluna->GetInstanceData(instanceMap); + if (instanceData) + *instanceData = sEluna->GetInstanceData(instanceMap); } void OnDestroyInstance(MapInstanced* /*mapInstanced*/, Map* map) override