Core/Creature: drop method SetPosition

Port From (https://github.com/TrinityCore/TrinityCore/commit/55576d20d837a9b4575c11a73940c29c0e8e605b)
This commit is contained in:
hondacrx
2020-06-19 19:51:09 -04:00
parent 15192d6a38
commit 4fb3805d8a
4 changed files with 3 additions and 17 deletions
+1 -1
View File
@@ -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
{
-14
View File
@@ -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.