From cfee8a09a172d953d3b2263a7917a4d4a61461ab Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sun, 6 May 2018 18:47:51 +0200 Subject: [PATCH] Core/Maps: Fixed loading vmaps and mmaps in instances (ported commit b773d9997bdd723cad8c646170e025a48f140f1d) --- src/server/game/Entities/Object/Object.cpp | 6 -- src/server/game/Entities/Object/Object.h | 3 - src/server/game/Entities/Player/Player.cpp | 8 +- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Grids/NGrid.cpp | 4 +- src/server/game/Grids/NGrid.h | 5 +- src/server/game/Handlers/MovementHandler.cpp | 2 +- src/server/game/Maps/Map.cpp | 92 ++++++++----------- src/server/game/Maps/Map.h | 8 +- src/server/game/Maps/MapInstanced.cpp | 2 - src/server/game/Maps/MapInstanced.h | 15 --- .../RandomMovementGenerator.cpp | 2 +- src/server/game/Movement/PathGenerator.cpp | 6 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 2 +- .../Deadmines/boss_foe_reaper_5000.cpp | 2 +- 15 files changed, 56 insertions(+), 105 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 7627919231a..12a0d60cecd 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2026,12 +2026,6 @@ void WorldObject::ResetMap() //m_InstanceId = 0; } -Map const* WorldObject::GetBaseMap() const -{ - ASSERT(m_currMap); - return m_currMap->GetParent(); -} - void WorldObject::AddObjectToRemoveList() { ASSERT(m_uint32Values); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index f9cf002cce2..8432821e298 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -385,9 +385,6 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation Map* FindMap() const { return m_currMap; } //used to check all object's GetMap() calls when object is not in world! - //this function should be removed in nearest time... - Map const* GetBaseMap() const; - void SetZoneScript(); void ClearZoneScript(); ZoneScript* GetZoneScript() const { return m_zoneScript; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 40fce35fde6..cb28cfe8d45 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1317,7 +1317,7 @@ void Player::Update(uint32 p_time) } // not auto-free ghost from body in instances - if (m_deathTimer > 0 && !GetBaseMap()->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION)) + if (m_deathTimer > 0 && !GetMap()->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION)) { if (p_time >= m_deathTimer) { @@ -2466,7 +2466,7 @@ GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid const& guid, Gameo bool Player::IsUnderWater() const { return IsInWater() && - GetPositionZ() < (GetBaseMap()->GetWaterLevel(GetPhaseShift(), GetPositionX(), GetPositionY())-2); + GetPositionZ() < (GetMap()->GetWaterLevel(GetPhaseShift(), GetPositionX(), GetPositionY())-2); } void Player::SetInWater(bool apply) @@ -5731,7 +5731,7 @@ void Player::GiveXpForGather(uint32 const& skillId, uint32 const& reqSkillValue) if (skillId != SKILL_HERBALISM && skillId != SKILL_MINING && skillId != SKILL_ARCHAEOLOGY) return; - uint32 areaId = GetBaseMap()->GetAreaId(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ()); + uint32 areaId = GetMap()->GetAreaId(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ()); AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId); if (!areaEntry) @@ -6426,7 +6426,7 @@ void Player::CheckAreaExploreAndOutdoor() return; bool isOutdoor; - uint32 areaId = GetBaseMap()->GetAreaId(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ(), &isOutdoor); + uint32 areaId = GetMap()->GetAreaId(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ(), &isOutdoor); AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId); if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 754db24f082..8d106588b40 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3170,12 +3170,12 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const bool Unit::IsInWater() const { - return GetBaseMap()->IsInWater(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ()); + return GetMap()->IsInWater(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ()); } bool Unit::IsUnderWater() const { - return GetBaseMap()->IsUnderWater(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ()); + return GetMap()->IsUnderWater(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ()); } void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z) diff --git a/src/server/game/Grids/NGrid.cpp b/src/server/game/Grids/NGrid.cpp index effedbfdb66..67540c49ec7 100644 --- a/src/server/game/Grids/NGrid.cpp +++ b/src/server/game/Grids/NGrid.cpp @@ -20,12 +20,12 @@ GridInfo::GridInfo() : i_timer(0), vis_Update(0, irand(0, DEFAULT_VISIBILITY_NOTIFY_PERIOD)), - i_unloadActiveLockCount(0), i_unloadExplicitLock(false), i_unloadReferenceLock(false) + i_unloadActiveLockCount(0), i_unloadExplicitLock(false) { } GridInfo::GridInfo(time_t expiry, bool unload /*= true*/) : i_timer(expiry), vis_Update(0, irand(0, DEFAULT_VISIBILITY_NOTIFY_PERIOD)), - i_unloadActiveLockCount(0), i_unloadExplicitLock(!unload), i_unloadReferenceLock(false) + i_unloadActiveLockCount(0), i_unloadExplicitLock(!unload) { } diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h index b1e81002fad..2ee1bcd95dd 100644 --- a/src/server/game/Grids/NGrid.h +++ b/src/server/game/Grids/NGrid.h @@ -35,9 +35,8 @@ public: GridInfo(); GridInfo(time_t expiry, bool unload = true); TimeTracker const& getTimeTracker() const { return i_timer; } - bool getUnloadLock() const { return i_unloadActiveLockCount || i_unloadExplicitLock || i_unloadReferenceLock; } + bool getUnloadLock() const { return i_unloadActiveLockCount || i_unloadExplicitLock; } void setUnloadExplicitLock(bool on) { i_unloadExplicitLock = on; } - void setUnloadReferenceLock(bool on) { i_unloadReferenceLock = on; } void incUnloadActiveLock() { ++i_unloadActiveLockCount; } void decUnloadActiveLock() { if (i_unloadActiveLockCount) --i_unloadActiveLockCount; } @@ -51,7 +50,6 @@ private: uint16 i_unloadActiveLockCount : 16; // lock from active object spawn points (prevent clone loading) bool i_unloadExplicitLock : 1; // explicit manual lock or config setting - bool i_unloadReferenceLock : 1; // lock from instance map copy }; typedef enum @@ -109,7 +107,6 @@ class NGrid TimeTracker const& getTimeTracker() const { return i_GridInfo.getTimeTracker(); } bool getUnloadLock() const { return i_GridInfo.getUnloadLock(); } void setUnloadExplicitLock(bool on) { i_GridInfo.setUnloadExplicitLock(on); } - void setUnloadReferenceLock(bool on) { i_GridInfo.setUnloadReferenceLock(on); } void incUnloadActiveLock() { i_GridInfo.incUnloadActiveLock(); } void decUnloadActiveLock() { i_GridInfo.decUnloadActiveLock(); } void ResetTimeTracker(time_t interval) { i_GridInfo.ResetTimeTracker(interval); } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 6cf393fd159..f1a4e1a1bde 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -373,7 +373,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) if (plrMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plrMover->IsInWater()) { // now client not include swimming flag in case jumping under water - plrMover->SetInWater(!plrMover->IsInWater() || plrMover->GetBaseMap()->IsUnderWater(plrMover->GetPhaseShift(), movementInfo.pos.GetPositionX(), movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ())); + plrMover->SetInWater(!plrMover->IsInWater() || plrMover->GetMap()->IsUnderWater(plrMover->GetPhaseShift(), movementInfo.pos.GetPositionX(), movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ())); } uint32 mstime = GameTime::GetGameTimeMS(); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index f4d9d044b6d..3d63f89fa54 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -172,41 +172,30 @@ void Map::LoadVMap(int gx, int gy) } } -void Map::LoadMap(int gx, int gy, bool reload) +void Map::LoadMap(int gx, int gy) { - LoadMapImpl(this, gx, gy, reload); + LoadMapImpl(this, gx, gy); for (Map* childBaseMap : *m_childTerrainMaps) - childBaseMap->LoadMap(gx, gy, reload); + childBaseMap->LoadMap(gx, gy); } -void Map::LoadMapImpl(Map* map, int gx, int gy, bool reload) +void Map::LoadMapImpl(Map* map, int gx, int gy) { - if (map->i_InstanceId != 0) - { - if (map->GridMaps[gx][gy]) - return; - - // load grid map for base map - GridCoord ngridCoord = GridCoord((MAX_NUMBER_OF_GRIDS - 1) - gx, (MAX_NUMBER_OF_GRIDS - 1) - gy); - if (!map->m_parentMap->getNGrid(ngridCoord.x_coord, ngridCoord.y_coord)) - map->m_parentMap->EnsureGridCreated(ngridCoord); - - static_cast(map->m_parentMap)->AddGridMapReference(GridCoord(gx, gy)); - map->GridMaps[gx][gy] = map->m_parentMap->GridMaps[gx][gy]; - return; - } - - if (map->GridMaps[gx][gy] && !reload) - return; - - //map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?) if (map->GridMaps[gx][gy]) - { - TC_LOG_DEBUG("maps", "Unloading previously loaded map %u before reloading.", map->GetId()); - sScriptMgr->OnUnloadGridMap(map, map->GridMaps[gx][gy], gx, gy); + return; - delete map->GridMaps[gx][gy]; - map->GridMaps[gx][gy] = nullptr; + Map* parent = map->m_parentMap; + ++parent->GridMapReference[gx][gy]; + + // load grid map for base map + if (parent != map) + { + GridCoord ngridCoord = GridCoord((MAX_NUMBER_OF_GRIDS - 1) - gx, (MAX_NUMBER_OF_GRIDS - 1) - gy); + if (!parent->GridMaps[gx][gy]) + parent->EnsureGridCreated(ngridCoord); + + map->GridMaps[gx][gy] = parent->GridMaps[gx][gy]; + return; } // map file name @@ -230,29 +219,25 @@ void Map::UnloadMap(int gx, int gy) void Map::UnloadMapImpl(Map* map, int gx, int gy) { - if (map->i_InstanceId == 0) + if (map->GridMaps[gx][gy]) { - if (map->GridMaps[gx][gy]) + Map* parent = map->m_parentMap; + if (!--parent->GridMapReference[gx][gy]) { - map->GridMaps[gx][gy]->unloadData(); - delete map->GridMaps[gx][gy]; + parent->GridMaps[gx][gy]->unloadData(); + delete parent->GridMaps[gx][gy]; + parent->GridMaps[gx][gy] = nullptr; } } - else - static_cast(map->m_parentMap)->RemoveGridMapReference(GridCoord(gx, gy)); map->GridMaps[gx][gy] = nullptr; } void Map::LoadMapAndVMap(int gx, int gy) { - m_parentTerrainMap->LoadMap(gx, gy); - // Only load the data for the base map - if (i_InstanceId == 0) - { - LoadVMap(gx, gy); - LoadMMap(gx, gy); - } + LoadMap(gx, gy); + LoadVMap(gx, gy); + LoadMMap(gx, gy); } void Map::LoadAllCells() @@ -306,6 +291,7 @@ i_scriptLock(false), _defaultLight(GetDefaultMapLight(id)) { //z code GridMaps[x][y] = nullptr; + GridMapReference[x][y] = 0; setNGrid(nullptr, x, y); } } @@ -512,20 +498,20 @@ void Map::EnsureGridCreated_i(const GridCoord &p) { TC_LOG_DEBUG("maps", "Creating grid[%u, %u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); - setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)), - p.x_coord, p.y_coord); + NGridType* ngrid = new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)); + setNGrid(ngrid, p.x_coord, p.y_coord); // build a linkage between this map and NGridType - buildNGridLinkage(getNGrid(p.x_coord, p.y_coord)); + buildNGridLinkage(ngrid); - getNGrid(p.x_coord, p.y_coord)->SetGridState(GRID_STATE_IDLE); + ngrid->SetGridState(GRID_STATE_IDLE); //z coord int gx = (MAX_NUMBER_OF_GRIDS - 1) - p.x_coord; int gy = (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord; if (!GridMaps[gx][gy]) - LoadMapAndVMap(gx, gy); + m_parentTerrainMap->LoadMapAndVMap(gx, gy); } } @@ -1657,17 +1643,13 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll) int gy = (MAX_NUMBER_OF_GRIDS - 1) - y; // delete grid map, but don't delete if it is from parent map (and thus only reference) - //+++if (GridMaps[gx][gy]) don't check for GridMaps[gx][gy], we might have to unload vmaps + if (GridMaps[gx][gy]) { - if (m_parentTerrainMap == this) - m_parentTerrainMap->UnloadMap(gx, gy); - - if (i_InstanceId == 0) - { - VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy); - MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(GetId(), gx, gy); - } + m_parentTerrainMap->UnloadMap(gx, gy); + VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_parentTerrainMap->GetId(), gx, gy); + MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(m_parentTerrainMap->GetId(), gx, gy); } + TC_LOG_DEBUG("maps", "Unloading grid[%u, %u] for map %u finished", x, y, GetId()); return true; } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 8d8beb07112..5abc02a5753 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -327,7 +327,6 @@ class TC_GAME_API Map : public GridRefManager static void InitStateMachine(); static void DeleteStateMachine(); - Map const* GetParent() const { return m_parentMap; } void AddChildTerrainMap(Map* map) { m_childTerrainMaps->push_back(map); map->m_parentTerrainMap = this; } void UnlinkAllChildTerrainMaps() { m_childTerrainMaps->clear(); } @@ -574,8 +573,8 @@ class TC_GAME_API Map : public GridRefManager void LoadMapAndVMap(int gx, int gy); void LoadVMap(int gx, int gy); - void LoadMap(int gx, int gy, bool reload = false); - static void LoadMapImpl(Map* map, int gx, int gy, bool reload); + void LoadMap(int gx, int gy); + static void LoadMapImpl(Map* map, int gx, int gy); void UnloadMap(int gx, int gy); static void UnloadMapImpl(Map* map, int gx, int gy); void LoadMMap(int gx, int gy); @@ -630,8 +629,6 @@ class TC_GAME_API Map : public GridRefManager void SendObjectUpdates(); protected: - void SetUnloadReferenceLock(const GridCoord &p, bool on) { getNGrid(p.x_coord, p.y_coord)->setUnloadReferenceLock(on); } - std::mutex _mapLock; std::mutex _gridLock; @@ -676,6 +673,7 @@ class TC_GAME_API Map : public GridRefManager NGridType* i_grids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; GridMap* GridMaps[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; + uint16 GridMapReference[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; std::bitset marked_cells; //these functions used to process player/mob aggro reactions and diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 7728862869c..a766652feb7 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -31,8 +31,6 @@ MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL) { - // fill with zero - memset(&GridMapReference, 0, MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_GRIDS*sizeof(uint16)); } void MapInstanced::InitVisibilityDistance() diff --git a/src/server/game/Maps/MapInstanced.h b/src/server/game/Maps/MapInstanced.h index 852e0263e8f..88608e29e0f 100644 --- a/src/server/game/Maps/MapInstanced.h +++ b/src/server/game/Maps/MapInstanced.h @@ -47,19 +47,6 @@ class TC_GAME_API MapInstanced : public Map } bool DestroyInstance(InstancedMaps::iterator &itr); - void AddGridMapReference(const GridCoord &p) - { - ++GridMapReference[p.x_coord][p.y_coord]; - SetUnloadReferenceLock(GridCoord((MAX_NUMBER_OF_GRIDS - 1) - p.x_coord, (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord), true); - } - - void RemoveGridMapReference(GridCoord const& p) - { - --GridMapReference[p.x_coord][p.y_coord]; - if (!GridMapReference[p.x_coord][p.y_coord]) - SetUnloadReferenceLock(GridCoord((MAX_NUMBER_OF_GRIDS - 1) - p.x_coord, (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord), false); - } - InstancedMaps &GetInstancedMaps() { return m_InstancedMaps; } virtual void InitVisibilityDistance() override; @@ -68,7 +55,5 @@ class TC_GAME_API MapInstanced : public Map BattlegroundMap* CreateBattleground(uint32 InstanceId, Battleground* bg); InstancedMaps m_InstancedMaps; - - uint16 GridMapReference[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; }; #endif diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 29de26b3e4d..00eac7db712 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -38,7 +38,7 @@ void RandomMovementGenerator::_setRandomLocation(Creature* creature) float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ; creature->GetHomePosition(respX, respY, respZ, respO); - Map const* map = creature->GetBaseMap(); + Map const* map = creature->GetMap(); // For 2D/3D system selection //bool is_land_ok = creature.CanWalk(); // not used? diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 8b2299fe62f..56a2ac02c05 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -186,7 +186,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con // Check both start and end points, if they're both in water, then we can *safely* let the creature move for (uint32 i = 0; i < _pathPoints.size(); ++i) { - ZLiquidStatus status = _sourceUnit->GetBaseMap()->GetLiquidStatus(_sourceUnit->GetPhaseShift(), _pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z, MAP_ALL_LIQUIDS, nullptr); + ZLiquidStatus status = _sourceUnit->GetMap()->GetLiquidStatus(_sourceUnit->GetPhaseShift(), _pathPoints[i].x, _pathPoints[i].y, _pathPoints[i].z, MAP_ALL_LIQUIDS, nullptr); // One of the points is not in the water, cancel movement. if (status == LIQUID_MAP_NO_WATER) { @@ -212,7 +212,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con Creature* owner = (Creature*)_sourceUnit; G3D::Vector3 const& p = (distToStartPoly > 7.0f) ? startPos : endPos; - if (_sourceUnit->GetBaseMap()->IsUnderWater(_sourceUnit->GetPhaseShift(), p.x, p.y, p.z)) + if (_sourceUnit->GetMap()->IsUnderWater(_sourceUnit->GetPhaseShift(), p.x, p.y, p.z)) { TC_LOG_DEBUG("maps", "++ BuildPolyPath :: underWater case\n"); if (owner->CanSwim()) @@ -649,7 +649,7 @@ void PathGenerator::UpdateFilter() NavTerrainFlag PathGenerator::GetNavTerrain(float x, float y, float z) { LiquidData data; - ZLiquidStatus liquidStatus = _sourceUnit->GetBaseMap()->GetLiquidStatus(_sourceUnit->GetPhaseShift(), x, y, z, MAP_ALL_LIQUIDS, &data); + ZLiquidStatus liquidStatus = _sourceUnit->GetMap()->GetLiquidStatus(_sourceUnit->GetPhaseShift(), x, y, z, MAP_ALL_LIQUIDS, &data); if (liquidStatus == LIQUID_MAP_NO_WATER) return NAV_GROUND; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index cbf9bef069f..0efe2c6712e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5054,7 +5054,7 @@ void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8 if (apply) aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER); - else if (!aurApp->GetTarget()->GetBaseMap()->Instanceable()) + else if (!aurApp->GetTarget()->GetMap()->Instanceable()) aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_FLAGS, PLAYER_FIELD_BYTE_RELEASE_TIMER); } diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_foe_reaper_5000.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_foe_reaper_5000.cpp index b0939e0c9c6..04086eb591d 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_foe_reaper_5000.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_foe_reaper_5000.cpp @@ -323,7 +323,7 @@ class boss_foe_reaper_5000 : public CreatureScript // and use our own position instead of our home position float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ; me->GetPosition(respX, respY, respZ, respO); - Map const* map = me->GetBaseMap(); + Map const* map = me->GetMap(); const float angle = float(rand_norm()) * static_cast(M_PI * 2.0f); const float range = 15.0f; const float distanceX = range * std::cos(angle);