[10759] Correctly reset mob orientation upon reaching spawn point. Should also improve visualisation of mob orientation on clients

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Schmoozerd 2010-11-20 19:38:02 +02:00 committed by Ambal
parent 07c48c77c9
commit ca56284912
5 changed files with 13 additions and 3 deletions

View file

@ -72,9 +72,10 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
// restore orientation of not moving creature at returning to home
if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
{
// such a mob might need very exact spawning point, hence relocate to spawn-position
if (CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetDBTableGUIDLow()))
{
owner.SetOrientation(data->orientation);
owner.Relocate(data->posX, data->posY, data->posZ, data->orientation);
owner.SendHeartBeat(false);
}
}