Permalink
Browse files

[s1028] Correctly reset mob orientation upon reaching spawn point. Sh…

…ould also improve visualisation of mob orientation on clients

Signed-off-by: Ambal <pogrebniak@gala.net>

(based on commit 14c9042)

Need re-apply at move moveinfo to Unit
  • Loading branch information...
1 parent 959f944 commit 1ae5eec4253e087c571a09f3625496854bd0a77c Schmoozerd committed with VladimirMangos Apr 3, 2011
Showing with 12 additions and 3 deletions.
  1. +1 −1 src/game/HomeMovementGenerator.cpp
  2. +8 −0 src/game/Object.cpp
  3. +1 −1 src/game/Object.h
  4. +1 −0 src/game/Unit.h
  5. +1 −1 src/shared/revision_nr.h
@@ -75,7 +75,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
// such a mob might need very exact spawning point, hence relocate to spawn-position
if (CreatureData const* data = sObjectMgr.GetCreatureData(owner.GetGUIDLow()))
{
- owner.SetOrientation(data->orientation);
+ owner.Relocate(data->posX, data->posY, data->posZ, data->orientation);
owner.SendHeartBeat(false);
}
}
View
@@ -1030,6 +1030,14 @@ void WorldObject::Relocate(float x, float y, float z)
((Player*)this)->m_movementInfo.ChangePosition(x, y, z, GetOrientation());
}
+void WorldObject::SetOrientation(float orientation)
+{
+ m_orientation = orientation;
+
+ if(GetTypeId() == TYPEID_PLAYER) //FIXME: to Unit at move moveinfor to Unit
+ ((Player*)this)->m_movementInfo.ChangeOrientation(orientation);
+}
+
uint32 WorldObject::GetZoneId() const
{
return GetTerrain()->GetZoneId(m_positionX, m_positionY, m_positionZ);
View
@@ -426,7 +426,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
void Relocate(float x, float y, float z, float orientation);
void Relocate(float x, float y, float z);
- void SetOrientation(float orientation) { m_orientation = orientation; }
+ void SetOrientation(float orientation);
float GetPositionX( ) const { return m_positionX; }
float GetPositionY( ) const { return m_positionY; }
View
@@ -685,6 +685,7 @@ class MovementInfo
Position const *GetTransportPos() const { return &t_pos; }
uint32 GetTransportTime() const { return t_time; }
uint32 GetFallTime() const { return fallTime; }
+ void ChangeOrientation(float o) { pos.o = o; }
void ChangePosition(float x, float y, float z, float o) { pos.x = x; pos.y = y; pos.z = z; pos.o = o; }
void UpdateTime(uint32 _time) { time = _time; }
View
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "1027"
+ #define REVISION_NR "1028"
#endif // __REVISION_NR_H__

0 comments on commit 1ae5eec

Please sign in to comment.