feat(Core/Modules): add separated lib for modules (#9281)

This commit is contained in:
Kargatum
2021-12-02 20:28:58 +07:00
committed by GitHub
parent 8668a03e14
commit 51adbffae4
56 changed files with 1904 additions and 1014 deletions

View File

@@ -23,12 +23,9 @@
#include "MapMgr.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "VMapFactory.h"
#ifdef ELUNA
#include "LuaEngine.h"
#endif
MapInstanced::MapInstanced(uint32 id) : Map(id, 0, DUNGEON_DIFFICULTY_NORMAL)
{
// initialize instanced maps list
@@ -253,23 +250,17 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun
bool MapInstanced::DestroyInstance(InstancedMaps::iterator& itr)
{
itr->second->RemoveAllPlayers();
if (itr->second->HavePlayers())
{
++itr;
return false;
}
sScriptMgr->OnDestroyInstance(this, itr->second);
itr->second->UnloadAll();
// Free up the instance id and allow it to be reused for bgs and arenas (other instances are handled in the InstanceSaveMgr)
//if (itr->second->IsBattlegroundOrArena())
// sMapMgr->FreeInstanceId(itr->second->GetInstanceId());
#ifdef ELUNA
//todo:[ELUNA] I'm not sure this is right.
sEluna->FreeInstanceId(itr->second->GetInstanceId());
#endif
// erase map
delete itr->second;
m_InstancedMaps.erase(itr++);