Skip to content

Commit 54dd4d3

Browse files
committed
Only use properly constructed keys to create new Lua states
1 parent 5af3892 commit 54dd4d3

File tree

5 files changed

+3
-6
lines changed

5 files changed

+3
-6
lines changed

src/server/game/LuaEngine

src/server/game/Maps/Map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ i_scriptLock(false), _respawnTimes(std::make_unique<RespawnListContainer>()), _r
288288
if (sElunaConfig->IsElunaEnabled() && sElunaConfig->ShouldMapLoadEluna(id))
289289
if (!IsParentMap() || (IsParentMap() && !Instanceable()))
290290
{
291-
elunaInfo = ElunaInfo(GetId(), GetInstanceId());
291+
elunaInfo.key = ElunaInfoKey::MakeKey(GetId(), GetInstanceId());
292292
sElunaMgr->Create(this, elunaInfo);
293293
}
294294
#endif

src/server/game/Maps/Map.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class BattlegroundMap;
4848
class CreatureGroup;
4949
#ifdef ELUNA
5050
class Eluna;
51-
struct ElunaInfo;
5251
#endif
5352
class GameObjectModel;
5453
class Group;
@@ -791,7 +790,6 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
791790
bool IsParentMap() const { return GetParent() == this; }
792791
#ifdef ELUNA
793792
Eluna* GetEluna() const { return sElunaMgr->Get(elunaInfo.key); }
794-
795793
LuaVal lua_data = LuaVal({});
796794
#endif
797795
private:

src/server/game/World/World.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,7 @@ void World::SetInitialWorldSettings()
21312131
if (sElunaConfig->IsElunaEnabled())
21322132
{
21332133
TC_LOG_INFO("server.loading", "Starting Eluna world state...");
2134-
elunaInfo = ElunaInfo(ElunaInfoKey::GLOBAL_MAP_ID, 0);
2134+
elunaInfo.key = ElunaInfoKey::MakeGlobalKey(0);
21352135
sElunaMgr->Create(nullptr, elunaInfo);
21362136
}
21372137
#endif

src/server/game/World/World.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
#ifdef ELUNA
4242
class Eluna;
43-
struct ElunaInfo;
4443
#endif
4544
class Player;
4645
class WorldPacket;

0 commit comments

Comments
 (0)