Rename "SetPosition" to "UpdatePosition".
Replace CreatureRelocation in scripts with new Creature::SetPosition.
This commit is contained in:
@@ -17151,16 +17151,16 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas
|
||||
{
|
||||
// FIXME: this interrupts spell visual
|
||||
DestroyForNearbyPlayers();
|
||||
SetPosition(x, y, z, orientation, true);
|
||||
UpdatePosition(x, y, z, orientation, true);
|
||||
}
|
||||
}
|
||||
|
||||
bool Unit::SetPosition(float x, float y, float z, float orientation, bool teleport)
|
||||
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
|
||||
{
|
||||
// prevent crash when a bad coord is sent by the client
|
||||
if (!Trinity::IsValidMapCoord(x, y, z, orientation))
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_UNITS, "Unit::SetPosition(%f, %f, %f) .. bad coordinates!", x, y, z);
|
||||
sLog->outDebug(LOG_FILTER_UNITS, "Unit::UpdatePosition(%f, %f, %f) .. bad coordinates!", x, y, z);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1600,9 +1600,9 @@ class Unit : public WorldObject
|
||||
void SendSpellDamageImmune(Unit* target, uint32 spellId);
|
||||
|
||||
void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false);
|
||||
virtual bool SetPosition(float x, float y, float z, float ang, bool teleport = false);
|
||||
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
|
||||
// returns true if unit's position really changed
|
||||
bool SetPosition(const Position &pos, bool teleport = false) { return SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
|
||||
void KnockbackFrom(float x, float y, float speedXY, float speedZ);
|
||||
void JumpTo(float speedXY, float speedZ, bool forward = true);
|
||||
|
||||
Reference in New Issue
Block a user