mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Core/Maps: Replaced spawnmask with difficulty list
This commit is contained in:
@@ -263,7 +263,7 @@ void Map::DeleteStateMachine()
|
||||
delete si_GridStates[GRID_STATE_REMOVAL];
|
||||
}
|
||||
|
||||
Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _parent):
|
||||
Map::Map(uint32 id, time_t expiry, uint32 InstanceId, Difficulty SpawnMode, Map* _parent):
|
||||
_creatureToMoveLock(false), _gameObjectsToMoveLock(false), _dynamicObjectsToMoveLock(false), _areaTriggersToMoveLock(false),
|
||||
i_mapEntry(sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode), i_InstanceId(InstanceId),
|
||||
m_unloadTimer(0), m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE),
|
||||
@@ -3325,7 +3325,7 @@ template TC_GAME_API void Map::RemoveFromMap(Conversation*, bool);
|
||||
|
||||
/* ******* Dungeon Instance Maps ******* */
|
||||
|
||||
InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _parent)
|
||||
InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, Difficulty SpawnMode, Map* _parent)
|
||||
: Map(id, expiry, InstanceId, SpawnMode, _parent),
|
||||
m_resetAfterUnload(false), m_unloadWhenEmpty(false),
|
||||
i_data(NULL), i_script_id(0), i_scenario(nullptr)
|
||||
@@ -3358,7 +3358,7 @@ Map::EnterState InstanceMap::CannotEnter(Player* player)
|
||||
{
|
||||
if (player->GetMapRef().getTarget() == this)
|
||||
{
|
||||
TC_LOG_ERROR("maps", "InstanceMap::CannotEnter - player %s(%s) already in map %d, %d, %d!", player->GetName().c_str(), player->GetGUID().ToString().c_str(), GetId(), GetInstanceId(), GetSpawnMode());
|
||||
TC_LOG_ERROR("maps", "InstanceMap::CannotEnter - player %s(%s) already in map %d, %d, %d!", player->GetName().c_str(), player->GetGUID().ToString().c_str(), GetId(), GetInstanceId(), GetDifficultyID());
|
||||
ABORT();
|
||||
return CANNOT_ENTER_ALREADY_IN_MAP;
|
||||
}
|
||||
@@ -3416,14 +3416,14 @@ bool InstanceMap::AddPlayerToMap(Player* player, bool initPlayer /*= true*/)
|
||||
InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
|
||||
if (!mapSave)
|
||||
{
|
||||
TC_LOG_DEBUG("maps", "InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
|
||||
mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, 0, true);
|
||||
TC_LOG_DEBUG("maps", "InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetDifficultyID(), GetInstanceId());
|
||||
mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), GetDifficultyID(), 0, 0, true);
|
||||
}
|
||||
|
||||
ASSERT(mapSave);
|
||||
|
||||
// check for existing instance binds
|
||||
InstancePlayerBind* playerBind = player->GetBoundInstance(GetId(), Difficulty(GetSpawnMode()));
|
||||
InstancePlayerBind* playerBind = player->GetBoundInstance(GetId(), GetDifficultyID());
|
||||
if (playerBind && playerBind->perm)
|
||||
{
|
||||
// cannot enter other instances if bound permanently
|
||||
@@ -3714,10 +3714,10 @@ void InstanceMap::SetResetSchedule(bool on)
|
||||
if (IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon())
|
||||
{
|
||||
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()))
|
||||
sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
|
||||
sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), GetDifficultyID(), GetInstanceId()));
|
||||
else
|
||||
TC_LOG_ERROR("maps", "InstanceMap::SetResetSchedule: cannot turn schedule %s, there is no save information for instance (map [id: %u, name: %s], instance id: %u, difficulty: %u)",
|
||||
on ? "on" : "off", GetId(), GetMapName(), GetInstanceId(), Difficulty(GetSpawnMode()));
|
||||
on ? "on" : "off", GetId(), GetMapName(), GetInstanceId(), GetDifficultyID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3831,7 +3831,7 @@ uint32 InstanceMap::GetMaxResetDelay() const
|
||||
|
||||
/* ******* Battleground Instance Maps ******* */
|
||||
|
||||
BattlegroundMap::BattlegroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent, uint8 spawnMode)
|
||||
BattlegroundMap::BattlegroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent, Difficulty spawnMode)
|
||||
: Map(id, expiry, InstanceId, spawnMode, _parent), m_bg(NULL)
|
||||
{
|
||||
//lets initialize visibility distance for BG/Arenas
|
||||
|
||||
Reference in New Issue
Block a user