Core/Phases: backported 6.x phase fixes
This commit is contained in:
1 parent
1103f0889d
commit
037fd1b1bb
3 files changed
+29
-2
No files matched your search
@@ -481,6 +481,12 @@ namespace MMAP
|
||||
|
||||
const dtMeshTile* oldTile = navMesh->getTileByRef(loadedTileRefs[packedXY]);
|
||||
|
||||
if (!oldTile)
|
||||
{
|
||||
TC_LOG_DEBUG("phase", "MMapData::AddSwap: phased mmtile %03u[%02i, %02i] load skipped, due to not loaded base tile ref on map %u", swap, x, y, _mapId);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 old_x = oldTile->header->x;
|
||||
uint32 old_y = oldTile->header->y;
|
||||
|
||||
|
||||
@@ -2861,10 +2861,10 @@ bool WorldObject::IsInPhase(WorldObject const* obj) const
|
||||
if (_phases.empty() && obj->GetPhases().empty())
|
||||
return true;
|
||||
|
||||
if (_phases.empty() && obj->IsInPhase(169))
|
||||
if (_phases.empty() && obj->IsInPhase(DEFAULT_PHASE))
|
||||
return true;
|
||||
|
||||
if (obj->GetPhases().empty() && IsInPhase(169))
|
||||
if (obj->GetPhases().empty() && IsInPhase(DEFAULT_PHASE))
|
||||
return true;
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->IsGameMaster())
|
||||
@@ -3082,4 +3082,23 @@ void WorldObject::RebuildWorldMapAreaSwaps()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check all applied phases for world map area swaps
|
||||
for (uint32 phaseId : _phases)
|
||||
{
|
||||
std::list<uint32>& swaps = sObjectMgr->GetPhaseTerrainSwaps(phaseId);
|
||||
|
||||
for (uint32 swap : swaps)
|
||||
{
|
||||
// add world map swaps for ANY map
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_TERRAIN_SWAP, swap);
|
||||
|
||||
if (sConditionMgr->IsObjectMeetToConditions(this, conditions))
|
||||
{
|
||||
for (uint32 map : sObjectMgr->GetTerrainWorldMaps(swap))
|
||||
_worldMapAreaSwaps.insert(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,8 @@
|
||||
#define NOMINAL_MELEE_RANGE 5.0f
|
||||
#define MELEE_RANGE (NOMINAL_MELEE_RANGE - MIN_MELEE_REACH * 2) //center to center for players
|
||||
|
||||
#define DEFAULT_PHASE 169
|
||||
|
||||
enum TempSummonType
|
||||
{
|
||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN = 1, // despawns after a specified time OR when the creature disappears
|
||||
|
||||
Reference in new issue
Block a user