Skip to content

Commit

Permalink
Move Map OnCreate hook to better location
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Oct 18, 2024
1 parent c6d30f6 commit 6459fed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 6 additions & 0 deletions src/game/Maps/MapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <future>

#ifdef BUILD_ELUNA
#include "LuaEngine/LuaEngine.h"
#include "LuaEngine/ElunaConfig.h"
#endif

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 6459fed

Please sign in to comment.