Skip to content

Commit 62c61a4

Browse files
committed
Reduce Eluna diff footprint
1 parent 380356f commit 62c61a4

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/server/game/Entities/Object/Object.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ void WorldObject::SetMap(Map* map)
18411841
}
18421842
#endif
18431843
if (IsStoredInWorldObjectGridContainer())
1844-
m_currMap->AddWorldObject(this);
1844+
m_currMap->AddWorldObject(this);
18451845
}
18461846

18471847
void WorldObject::ResetMap()
@@ -1850,7 +1850,6 @@ void WorldObject::ResetMap()
18501850
ASSERT(!IsInWorld());
18511851
if (IsStoredInWorldObjectGridContainer())
18521852
m_currMap->RemoveWorldObject(this);
1853-
18541853
m_currMap = nullptr;
18551854
//maybe not for corpse
18561855
//m_mapId = 0;

src/server/game/Maps/MapInstanced.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
#include "VMapManager2.h"
3131
#include "World.h"
3232

33-
#ifdef ELUNA
34-
#include "LuaEngine.h"
35-
#endif
36-
3733
MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
3834
{
3935
// fill with zero
@@ -276,12 +272,6 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun
276272
map->SetWeakPtr(ptr);
277273

278274
sScriptMgr->OnCreateMap(map);
279-
280-
#ifdef ELUNA
281-
if(Eluna* e = map->GetEluna())
282-
e->OnBGCreate(bg, bg->GetTypeID(), bg->GetInstanceID());
283-
#endif
284-
285275
return map;
286276
}
287277

src/server/game/Scripting/ScriptMgr.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,15 @@ void ScriptMgr::OnCreateMap(Map* map)
14291429

14301430
#ifdef ELUNA
14311431
if (Eluna* e = map->GetEluna())
1432+
{
14321433
e->OnCreate(map);
1434+
if (map->IsBattlegroundOrArena())
1435+
{
1436+
BattleGround* bg = ((BattlegroundMap*)map)->GetBG();
1437+
if(bg)
1438+
e->OnBGCreate(bg, bg->GetTypeID(), bg->GetInstanceID());
1439+
}
1440+
}
14331441
#endif
14341442

14351443
SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);

0 commit comments

Comments
 (0)