From 6459fed062530a6f34a8735c39840e3e243fb0ed Mon Sep 17 00:00:00 2001 From: Niam5 Date: Sun, 18 Aug 2024 00:56:57 -0700 Subject: [PATCH] Move Map OnCreate hook to better location --- src/game/Maps/Map.cpp | 3 --- src/game/Maps/MapManager.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 72970045a0..4ee4531da6 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -194,9 +194,6 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) if (sElunaConfig->IsElunaEnabled() && !sElunaConfig->IsElunaCompatibilityMode() && sElunaConfig->ShouldMapLoadEluna(id)) eluna = new Eluna(this); - - if (Eluna* e = GetEluna()) - e->OnCreate(this); #endif } diff --git a/src/game/Maps/MapManager.cpp b/src/game/Maps/MapManager.cpp index e729882002..325f7324a3 100644 --- a/src/game/Maps/MapManager.cpp +++ b/src/game/Maps/MapManager.cpp @@ -31,6 +31,7 @@ #include #ifdef BUILD_ELUNA +#include "LuaEngine/LuaEngine.h" #include "LuaEngine/ElunaConfig.h" #endif @@ -159,6 +160,11 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj) } } +#ifdef BUILD_ELUNA + if (Eluna* e = m->GetEluna()) + e->OnCreate(m); +#endif + return m; }