mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[9497] Implement basic use of SPLINETYPE_FACINGTARGET
Adjust related helper function accordingly. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
4a051e2443
commit
44d768cac5
3 changed files with 24 additions and 4 deletions
|
|
@ -388,8 +388,8 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, SplineTy
|
||||||
data << float(0);
|
data << float(0);
|
||||||
data << float(0);
|
data << float(0);
|
||||||
break;
|
break;
|
||||||
case SPLINETYPE_FACINGTARGET: // not used currently
|
case SPLINETYPE_FACINGTARGET:
|
||||||
data << uint64(0); // probably target guid (facing target?)
|
data << uint64(m_InteractionObject); // set in SetFacingToObject()
|
||||||
break;
|
break;
|
||||||
case SPLINETYPE_FACINGANGLE: // not used currently
|
case SPLINETYPE_FACINGANGLE: // not used currently
|
||||||
data << float(0); // facing angle
|
data << float(0); // facing angle
|
||||||
|
|
@ -3515,6 +3515,24 @@ void Unit::SetFacingTo(float ori)
|
||||||
SendMessageToSet(&data, false);
|
SendMessageToSet(&data, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consider move this to Creature:: since only creature appear to be able to use this
|
||||||
|
void Unit::SetFacingToObject(WorldObject* pObject)
|
||||||
|
{
|
||||||
|
if (GetTypeId() != TYPEID_UNIT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// never face when already moving
|
||||||
|
if (!IsStopped())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_InteractionObject = pObject->GetGUID();
|
||||||
|
|
||||||
|
// TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is.
|
||||||
|
|
||||||
|
SetOrientation(GetAngle(pObject));
|
||||||
|
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_FACINGTARGET, ((Creature*)this)->GetSplineFlags(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
bool Unit::isInAccessablePlaceFor(Creature const* c) const
|
bool Unit::isInAccessablePlaceFor(Creature const* c) const
|
||||||
{
|
{
|
||||||
if(IsInWater())
|
if(IsInWater())
|
||||||
|
|
|
||||||
|
|
@ -1581,7 +1581,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
|
|
||||||
void SetInFront(Unit const* target);
|
void SetInFront(Unit const* target);
|
||||||
void SetFacingTo(float ori);
|
void SetFacingTo(float ori);
|
||||||
void SetFacingToObject(WorldObject* pObject) { SetFacingTo(GetAngle(pObject)); }
|
void SetFacingToObject(WorldObject* pObject);
|
||||||
|
|
||||||
// Visibility system
|
// Visibility system
|
||||||
UnitVisibility GetVisibility() const { return m_Visibility; }
|
UnitVisibility GetVisibility() const { return m_Visibility; }
|
||||||
|
|
@ -1842,6 +1842,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
uint32 m_regenTimer;
|
uint32 m_regenTimer;
|
||||||
uint32 m_lastManaUseTimer;
|
uint32 m_lastManaUseTimer;
|
||||||
|
|
||||||
|
uint64 m_InteractionObject;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CleanupDeletedAuras();
|
void CleanupDeletedAuras();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9496"
|
#define REVISION_NR "9497"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue