mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-19 14:29:33 -04:00
Core: Fix some build errors after code style cleanup
This commit is contained in:
@@ -16794,7 +16794,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
RelocateToHomebind();
|
||||
}
|
||||
|
||||
// fix crash (because of if (Map* map = _FindMap(instanceId)) in Mainstanced::CreateInstance)
|
||||
// fix crash (because of if (Map* map = _FindMap(instanceId)) in MapInstanced::CreateInstance)
|
||||
if (instanceId)
|
||||
if (InstanceSave* save = GetInstanceSave(mapId, mapEntry->IsRaid()))
|
||||
if (save->GetInstanceId() != instanceId)
|
||||
|
||||
@@ -511,7 +511,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr)
|
||||
void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);
|
||||
Map* map = (Mainstanced*)sMapMgr->CreateBaseMap(mapid);
|
||||
Map* map = (MapInstanced*)sMapMgr->CreateBaseMap(mapid);
|
||||
if (!map->Instanceable())
|
||||
return;
|
||||
|
||||
@@ -521,7 +521,7 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
|
||||
|
||||
DeleteInstanceFromDB(instanceId); // even if save not loaded
|
||||
|
||||
Map* iMap = ((Mainstanced*)map)->FindMap(instanceId);
|
||||
Map* iMap = ((MapInstanced*)map)->FindMap(instanceId);
|
||||
|
||||
if (iMap && iMap->IsDungeon())
|
||||
((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
|
||||
@@ -584,8 +584,8 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
||||
|
||||
// note: this isn't fast but it's meant to be executed very rarely
|
||||
Map const* map = sMapMgr->CreateBaseMap(mapid); // _not_ include difficulty
|
||||
Mainstanced::InstancedMaps &instMaps = ((Mainstanced*)map)->GetInstancedMaps();
|
||||
Mainstanced::InstancedMaps::iterator mitr;
|
||||
MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps();
|
||||
MapInstanced::InstancedMaps::iterator mitr;
|
||||
uint32 timeLeft;
|
||||
|
||||
for (mitr = instMaps.begin(); mitr != instMaps.end(); ++mitr)
|
||||
|
||||
@@ -143,7 +143,7 @@ void Map::LoadMap(int gx, int gy, bool reload)
|
||||
if (!m_parentMap->GridMaps[gx][gy])
|
||||
m_parentMap->EnsureGridCreated(GridPair(63-gx, 63-gy));
|
||||
|
||||
((Mainstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx, gy));
|
||||
((MapInstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx, gy));
|
||||
GridMaps[gx][gy] = m_parentMap->GridMaps[gx][gy];
|
||||
return;
|
||||
}
|
||||
@@ -992,7 +992,7 @@ bool Map::UnloadGrid(const uint32 x, const uint32 y, bool unloadAll)
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy);
|
||||
}
|
||||
else
|
||||
((Mainstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy));
|
||||
((MapInstanced*)m_parentMap)->RemoveGridMapReference(GridPair(gx, gy));
|
||||
|
||||
GridMaps[gx][gy] = NULL;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ struct ScriptInfo;
|
||||
struct ScriptAction;
|
||||
struct Position;
|
||||
class Battleground;
|
||||
class Mainstanced;
|
||||
class MapInstanced;
|
||||
class InstanceMap;
|
||||
namespace Trinity { struct ObjectUpdater; }
|
||||
|
||||
@@ -429,8 +429,8 @@ class Map : public GridRefManager<NGridType>
|
||||
GameObject* GetGameObject(uint64 guid);
|
||||
DynamicObject* GetDynamicObject(uint64 guid);
|
||||
|
||||
Mainstanced* ToMainstanced(){ if (Instanceable()) return reinterpret_cast<Mainstanced*>(this); else return NULL; }
|
||||
const Mainstanced* ToMainstanced() const { if (Instanceable()) return (const Mainstanced*)((Mainstanced*)this); else return NULL; }
|
||||
MapInstanced* ToMainstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; }
|
||||
const MapInstanced* ToMainstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; }
|
||||
|
||||
InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; }
|
||||
const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; }
|
||||
@@ -508,7 +508,7 @@ class Map : public GridRefManager<NGridType>
|
||||
|
||||
time_t i_gridExpiry;
|
||||
|
||||
//used for fast base_map (e.g. Mainstanced class object) search for
|
||||
//used for fast base_map (e.g. MapInstanced class object) search for
|
||||
//InstanceMaps and BattlegroundMaps...
|
||||
Map* m_parentMap;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "World.h"
|
||||
#include "Group.h"
|
||||
|
||||
Mainstanced::Mainstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
|
||||
MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
|
||||
{
|
||||
// initialize instanced maps list
|
||||
m_InstancedMaps.clear();
|
||||
@@ -33,7 +33,7 @@ Mainstanced::Mainstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_
|
||||
memset(&GridMapReference, 0, MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_GRIDS*sizeof(uint16));
|
||||
}
|
||||
|
||||
void Mainstanced::InitVisibilityDistance()
|
||||
void MapInstanced::InitVisibilityDistance()
|
||||
{
|
||||
if (m_InstancedMaps.empty())
|
||||
return;
|
||||
@@ -44,7 +44,7 @@ void Mainstanced::InitVisibilityDistance()
|
||||
}
|
||||
}
|
||||
|
||||
void Mainstanced::Update(const uint32 t)
|
||||
void MapInstanced::Update(const uint32 t)
|
||||
{
|
||||
// take care of loaded GridMaps (when unused, unload it!)
|
||||
Map::Update(t);
|
||||
@@ -73,7 +73,7 @@ void Mainstanced::Update(const uint32 t)
|
||||
}
|
||||
}
|
||||
|
||||
void Mainstanced::DelayedUpdate(const uint32 diff)
|
||||
void MapInstanced::DelayedUpdate(const uint32 diff)
|
||||
{
|
||||
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
|
||||
i->second->DelayedUpdate(diff);
|
||||
@@ -82,14 +82,14 @@ void Mainstanced::DelayedUpdate(const uint32 diff)
|
||||
}
|
||||
|
||||
/*
|
||||
void Mainstanced::RelocationNotify()
|
||||
void MapInstanced::RelocationNotify()
|
||||
{
|
||||
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
|
||||
i->second->RelocationNotify();
|
||||
}
|
||||
*/
|
||||
|
||||
void Mainstanced::UnloadAll()
|
||||
void MapInstanced::UnloadAll()
|
||||
{
|
||||
// Unload instanced maps
|
||||
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
|
||||
@@ -110,7 +110,7 @@ void Mainstanced::UnloadAll()
|
||||
- create the instance if it's not created already
|
||||
- the player is not actually added to the instance (only in InstanceMap::Add)
|
||||
*/
|
||||
Map* Mainstanced::CreateInstance(const uint32 mapId, Player* player)
|
||||
Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
|
||||
{
|
||||
if (GetId() != mapId || !player)
|
||||
return NULL;
|
||||
@@ -170,7 +170,7 @@ Map* Mainstanced::CreateInstance(const uint32 mapId, Player* player)
|
||||
return map;
|
||||
}
|
||||
|
||||
InstanceMap* Mainstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty)
|
||||
InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty)
|
||||
{
|
||||
// load/create a map
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
|
||||
@@ -192,7 +192,7 @@ InstanceMap* Mainstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
|
||||
// some instances only have one difficulty
|
||||
GetDownscaledMapDifficultyData(GetId(), difficulty);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "Mainstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal");
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal");
|
||||
|
||||
InstanceMap* map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this);
|
||||
ASSERT(map->IsDungeon());
|
||||
@@ -204,12 +204,12 @@ InstanceMap* Mainstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
|
||||
return map;
|
||||
}
|
||||
|
||||
BattlegroundMap* Mainstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
|
||||
BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battleground* bg)
|
||||
{
|
||||
// load/create a map
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "Mainstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());
|
||||
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel());
|
||||
|
||||
@@ -230,7 +230,7 @@ BattlegroundMap* Mainstanced::CreateBattleground(uint32 InstanceId, Battleground
|
||||
}
|
||||
|
||||
// increments the iterator after erase
|
||||
bool Mainstanced::DestroyInstance(InstancedMaps::iterator &itr)
|
||||
bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
|
||||
{
|
||||
itr->second->RemoveAllPlayers();
|
||||
if (itr->second->HavePlayers())
|
||||
@@ -260,7 +260,7 @@ bool Mainstanced::DestroyInstance(InstancedMaps::iterator &itr)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Mainstanced::CanEnter(Player* /*player*/)
|
||||
bool MapInstanced::CanEnter(Player* /*player*/)
|
||||
{
|
||||
//ASSERT(false);
|
||||
return true;
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "DBCEnums.h"
|
||||
|
||||
class Mainstanced : public Map
|
||||
class MapInstanced : public Map
|
||||
{
|
||||
friend class MapManager;
|
||||
public:
|
||||
typedef UNORDERED_MAP< uint32, Map*> InstancedMaps;
|
||||
|
||||
Mainstanced(uint32 id, time_t expiry);
|
||||
~Mainstanced() {}
|
||||
MapInstanced(uint32 id, time_t expiry);
|
||||
~MapInstanced() {}
|
||||
|
||||
// functions overwrite Map versions
|
||||
void Update(const uint32);
|
||||
|
||||
@@ -106,7 +106,7 @@ Map* MapManager::_createBaseMap(uint32 id)
|
||||
const MapEntry* entry = sMapStore.LookupEntry(id);
|
||||
if (entry && entry->Instanceable())
|
||||
{
|
||||
m = new Mainstanced(id, i_gridCleanUpDelay);
|
||||
m = new MapInstanced(id, i_gridCleanUpDelay);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -125,7 +125,7 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj, uint32 /*instanceI
|
||||
//if (!obj->IsInWorld()) sLog->outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId());
|
||||
Map* m = _createBaseMap(id);
|
||||
|
||||
if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((Mainstanced*)m)->CreateInstance(id, (Player*)obj);
|
||||
if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((MapInstanced*)m)->CreateInstance(id, (Player*)obj);
|
||||
|
||||
return m;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
|
||||
if (!map->Instanceable())
|
||||
return instanceId == 0 ? map : NULL;
|
||||
|
||||
return ((Mainstanced*)map)->FindMap(instanceId);
|
||||
return ((MapInstanced*)map)->FindMap(instanceId);
|
||||
}
|
||||
|
||||
bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
@@ -343,8 +343,8 @@ uint32 MapManager::GetNumInstances()
|
||||
Map* map = itr->second;
|
||||
if (!map->Instanceable())
|
||||
continue;
|
||||
Mainstanced::InstancedMaps &maps = ((Mainstanced*)map)->GetInstancedMaps();
|
||||
for (Mainstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps();
|
||||
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
if (mitr->second->IsDungeon()) ret++;
|
||||
}
|
||||
return ret;
|
||||
@@ -360,8 +360,8 @@ uint32 MapManager::GetNumPlayersInInstances()
|
||||
Map* map = itr->second;
|
||||
if (!map->Instanceable())
|
||||
continue;
|
||||
Mainstanced::InstancedMaps &maps = ((Mainstanced*)map)->GetInstancedMaps();
|
||||
for (Mainstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps();
|
||||
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
if (mitr->second->IsDungeon())
|
||||
ret += ((InstanceMap*)mitr->second)->GetPlayers().getSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user