mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 10:37:02 +00:00
[0048] Enable SMSG_MONSTER_MOVE, CMSG_SET_SELECTION and send normalized orientation in update and movement packets for client to react normally.
Signed-off-by: Yaki Khadafi <ElSolDolLo@gmail.com>
This commit is contained in:
parent
f592231863
commit
cfae212258
9 changed files with 32 additions and 30 deletions
|
|
@ -448,7 +448,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
|
|||
*data << float(unit->GetSpeed(MOVE_TURN_RATE));
|
||||
|
||||
if (hasOrientation)
|
||||
*data << float(unit->GetOrientation());
|
||||
*data << float(NormalizeOrientation(unit->GetOrientation()));
|
||||
|
||||
*data << float(unit->GetSpeed(MOVE_RUN));
|
||||
|
||||
|
|
@ -460,7 +460,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
|
|||
|
||||
if (updateFlags & UPDATEFLAG_VEHICLE)
|
||||
{
|
||||
*data << float(((WorldObject*)this)->GetOrientation());
|
||||
*data << float(NormalizeOrientation(((WorldObject*)this)->GetOrientation()));
|
||||
*data << uint32(((Unit*)this)->GetVehicleInfo()->GetEntry()->m_ID); // vehicle id
|
||||
}
|
||||
|
||||
|
|
@ -513,7 +513,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
|
|||
|
||||
if (updateFlags & UPDATEFLAG_HAS_POSITION)
|
||||
{
|
||||
*data << float(((WorldObject*)this)->GetOrientation());
|
||||
*data << float(NormalizeOrientation(((WorldObject*)this)->GetOrientation()));
|
||||
*data << float(((WorldObject*)this)->GetPositionX());
|
||||
*data << float(((WorldObject*)this)->GetPositionY());
|
||||
*data << float(((WorldObject*)this)->GetPositionZ());
|
||||
|
|
@ -1364,13 +1364,13 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
|
|||
float arc = arcangle;
|
||||
|
||||
// move arc to range 0.. 2*pi
|
||||
arc = MapManager::NormalizeOrientation(arc);
|
||||
arc = NormalizeOrientation(arc);
|
||||
|
||||
float angle = GetAngle(obj);
|
||||
angle -= m_position.o;
|
||||
|
||||
// move angle to range -pi ... +pi
|
||||
angle = MapManager::NormalizeOrientation(angle);
|
||||
angle = NormalizeOrientation(angle);
|
||||
if (angle > M_PI_F)
|
||||
angle -= 2.0f * M_PI_F;
|
||||
|
||||
|
|
@ -1736,7 +1736,7 @@ namespace MaNGOS
|
|||
{
|
||||
public:
|
||||
NearUsedPosDo(WorldObject const& obj, WorldObject const* searcher, float absAngle, ObjectPosSelector& selector)
|
||||
: i_object(obj), i_searcher(searcher), i_absAngle(MapManager::NormalizeOrientation(absAngle)), i_selector(selector) {}
|
||||
: i_object(obj), i_searcher(searcher), i_absAngle(NormalizeOrientation(absAngle)), i_selector(selector) {}
|
||||
|
||||
void operator()(Corpse*) const {}
|
||||
void operator()(DynamicObject*) const {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue