Core/Entities: Take terrain swaps into account when calculating LoS/height/area
This commit is contained in:
1 parent
ca39bc9b31
commit
ce4e137889
19 files changed
+111
-70
No files matched your search
@@ -40,6 +40,7 @@
|
||||
#include "MapManager.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -1850,7 +1851,9 @@ void ObjectMgr::LoadCreatures()
|
||||
if (GetMapDifficultyData(i, Difficulty(k)))
|
||||
spawnMasks[i] |= (1 << k);
|
||||
|
||||
_creatureDataStore.rehash(result->GetRowCount());
|
||||
PhaseShift phaseShift;
|
||||
|
||||
_creatureDataStore.reserve(result->GetRowCount());
|
||||
|
||||
do
|
||||
{
|
||||
@@ -2018,7 +2021,8 @@ void ObjectMgr::LoadCreatures()
|
||||
{
|
||||
uint32 zoneId = 0;
|
||||
uint32 areaId = 0;
|
||||
sMapMgr->GetZoneAndAreaId(zoneId, areaId, data.mapid, data.posX, data.posY, data.posZ);
|
||||
PhasingHandler::InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||
sMapMgr->GetZoneAndAreaId(phaseShift, zoneId, areaId, data.mapid, data.posX, data.posY, data.posZ);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_ZONE_AREA_DATA);
|
||||
|
||||
@@ -2191,7 +2195,9 @@ void ObjectMgr::LoadGameobjects()
|
||||
if (GetMapDifficultyData(i, Difficulty(k)))
|
||||
spawnMasks[i] |= (1 << k);
|
||||
|
||||
_gameObjectDataStore.rehash(result->GetRowCount());
|
||||
PhaseShift phaseShift;
|
||||
|
||||
_gameObjectDataStore.reserve(result->GetRowCount());
|
||||
|
||||
do
|
||||
{
|
||||
@@ -2367,7 +2373,8 @@ void ObjectMgr::LoadGameobjects()
|
||||
{
|
||||
uint32 zoneId = 0;
|
||||
uint32 areaId = 0;
|
||||
sMapMgr->GetZoneAndAreaId(zoneId, areaId, data.mapid, data.posX, data.posY, data.posZ);
|
||||
PhasingHandler::InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||
sMapMgr->GetZoneAndAreaId(phaseShift, zoneId, areaId, data.mapid, data.posX, data.posY, data.posZ);
|
||||
|
||||
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_GAMEOBJECT_ZONE_AREA_DATA);
|
||||
|
||||
@@ -6331,7 +6338,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team) const
|
||||
WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) const
|
||||
{
|
||||
// search for zone associated closest graveyard
|
||||
uint32 zoneId = sMapMgr->GetZoneId(MapId, x, y, z);
|
||||
uint32 zoneId = sMapMgr->GetZoneId(PhaseShift(), MapId, x, y, z);
|
||||
|
||||
if (!zoneId)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user