mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/Objects: SetZoneScript will now use map zone coordinates instead of using the cached zone id
This commit is contained in:
@@ -1047,6 +1047,8 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 /*phaseMask*
|
||||
//! Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there
|
||||
m_positionZ += GetHoverOffset();
|
||||
|
||||
UpdatePositionData();
|
||||
|
||||
LastUsedScriptID = GetScriptId();
|
||||
|
||||
if (IsSpiritHealer() || IsSpiritGuide() || (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GHOST_VISIBILITY))
|
||||
@@ -1064,8 +1066,6 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 /*phaseMask*
|
||||
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
|
||||
}
|
||||
|
||||
UpdatePositionData();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2168,10 +2168,12 @@ void WorldObject::SetZoneScript()
|
||||
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
|
||||
else if (!map->IsBattlegroundOrArena())
|
||||
{
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId()))
|
||||
uint32 zoneId = GetMap()->GetZoneId(GetPhaseShift(), GetPosition());
|
||||
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(zoneId))
|
||||
m_zoneScript = bf;
|
||||
else
|
||||
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId());
|
||||
m_zoneScript = sOutdoorPvPMgr->GetZoneScript(zoneId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user