mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Players: Include graveyards from terrain swap maps
This commit is contained in:
@@ -6342,7 +6342,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& lo
|
||||
uint32 MapId = location.GetMapId();
|
||||
|
||||
// search for zone associated closest graveyard
|
||||
uint32 zoneId = sMapMgr->GetZoneId(PhasingHandler::GetEmptyPhaseShift(), MapId, x, y, z);
|
||||
uint32 zoneId = sMapMgr->GetZoneId(conditionObject->GetPhaseShift(), MapId, x, y, z);
|
||||
|
||||
if (!zoneId)
|
||||
{
|
||||
@@ -6392,23 +6392,24 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(WorldLocation const& lo
|
||||
{
|
||||
GraveYardData const& data = range.first->second;
|
||||
|
||||
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(data.safeLocId);
|
||||
if (!entry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has record for not existing graveyard (WorldSafeLocsID %u), skipped.", data.safeLocId);
|
||||
continue;
|
||||
}
|
||||
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.AssertEntry(data.safeLocId);
|
||||
|
||||
// skip enemy faction graveyard
|
||||
// team == 0 case can be at call from .neargrave
|
||||
if (data.team != 0 && team != 0 && data.team != team)
|
||||
continue;
|
||||
|
||||
if (conditionObject && !sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_GRAVEYARD, data.safeLocId, conditionSource))
|
||||
continue;
|
||||
if (conditionObject)
|
||||
{
|
||||
if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_GRAVEYARD, data.safeLocId, conditionSource))
|
||||
continue;
|
||||
|
||||
if (int16(entry->MapID) == mapEntry->ParentMapID && !conditionObject->GetPhaseShift().HasVisibleMapId(entry->MapID))
|
||||
continue;
|
||||
}
|
||||
|
||||
// find now nearest graveyard at other map
|
||||
if (MapId != entry->map_id)
|
||||
if (MapId != entry->MapID && int16(entry->MapID) != mapEntry->ParentMapID)
|
||||
{
|
||||
// if find graveyard at different map from where entrance placed (or no entrance data), use any first
|
||||
if (!mapEntry
|
||||
|
||||
Reference in New Issue
Block a user