Core/Creature: drop method SetPosition
Port From (https://github.com/TrinityCore/TrinityCore/commit/55576d20d837a9b4575c11a73940c29c0e8e605b)
This commit is contained in:
@@ -162,7 +162,7 @@ namespace Game.Chat
|
||||
data.posZ = z;
|
||||
data.orientation = o;
|
||||
}
|
||||
creature.SetPosition(x, y, z, o);
|
||||
creature.UpdatePosition(x, y, z, o);
|
||||
creature.GetMotionMaster().Initialize();
|
||||
if (creature.IsAlive()) // dead creature will reset movement generator at respawn
|
||||
{
|
||||
|
||||
@@ -2616,20 +2616,6 @@ namespace Game.Entities
|
||||
}
|
||||
bool CanNotReachTarget() { return m_cannotReachTarget; }
|
||||
|
||||
public void SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
// prevent crash when a bad coord is sent by the client
|
||||
if (!GridDefines.IsValidMapCoord(x, y, z, o))
|
||||
{
|
||||
Log.outDebug(LogFilter.Unit, "Creature.SetPosition({0}, {1}, {2}) .. bad coordinates!", x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
GetMap().CreatureRelocation(ToCreature(), x, y, z, o);
|
||||
if (IsVehicle())
|
||||
GetVehicleKit().RelocatePassengers();
|
||||
}
|
||||
|
||||
public float GetAggroRange(Unit target)
|
||||
{
|
||||
// Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection.
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
|
||||
CreatureData data = creature.GetCreatureData();
|
||||
if (data != null)
|
||||
creature.SetPosition(data.posX, data.posY, data.posZ, data.orientation);
|
||||
creature.UpdatePosition(data.posX, data.posY, data.posZ, data.orientation);
|
||||
creature.DespawnOrUnsummon();
|
||||
|
||||
creature.SetCorpseDelay(corpseDelay);
|
||||
|
||||
@@ -722,7 +722,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
|
||||
me.GetPosition(out x, out y, out z);
|
||||
z = me.GetMap().GetHeight(me.GetPhaseShift(), x, y, z);
|
||||
me.GetMotionMaster().MovePoint(0, x, y, z);
|
||||
me.SetPosition(x, y, z, 0);
|
||||
me.UpdatePosition(x, y, z, 0);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
|
||||
Reference in New Issue
Block a user