diff options
| author | megamage <none@none> | 2009-04-09 13:39:23 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-04-09 13:39:23 -0500 |
| commit | 5a71d93bd24880866890f4b5193db60d4aff0c96 (patch) | |
| tree | a5b208dcae4a99012343aedd0dedcb7479900a6b /src/game/Object.cpp | |
| parent | ba4e54f2f7d411eb60c8927e358d2835019a657a (diff) | |
*Update vehicle code.
*Show correct visual effects to other players.
*Do not allow attack players on vehicle.
*Only dismiss vehicle when it is summoned.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
| -rw-r--r-- | src/game/Object.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 32a5d61a918..8aadd510fa9 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -286,7 +286,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2) { flags2 = ((Player*)this)->GetUnitMovementFlags(); - if(((Player*)this)->GetTransport()) + if(((Player*)this)->GetTransport() || ((Player*)this)->hasUnitState(UNIT_STAT_ONVEHICLE)) flags2 |= MOVEMENTFLAG_ONTRANSPORT; else flags2 &= ~MOVEMENTFLAG_ONTRANSPORT; @@ -336,7 +336,10 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint8 flags, uint32 flags2) { if(GetTypeId() == TYPEID_PLAYER) { - *data << (uint64)((Player*)this)->GetTransport()->GetGUID(); + if(((Player*)this)->hasUnitState(UNIT_STAT_ONVEHICLE)) + *data << (uint64)((Player*)this)->GetCharmGUID(); + else + *data << (uint64)((Player*)this)->GetTransport()->GetGUID(); *data << (float)((Player*)this)->GetTransOffsetX(); *data << (float)((Player*)this)->GetTransOffsetY(); *data << (float)((Player*)this)->GetTransOffsetZ(); @@ -1619,7 +1622,17 @@ void WorldObject::BuildHeartBeatMsg(WorldPacket *data) const *data << m_positionY; *data << m_positionZ; *data << m_orientation; - *data << uint32(0); + if(GetTypeId() == TYPEID_PLAYER && ((Unit*)this)->hasUnitState(UNIT_STAT_ONVEHICLE)) + { + *data << uint64(((Unit*)this)->GetCharmGUID()); + *data << float(((Player*)this)->GetTransOffsetX()); + *data << float(((Player*)this)->GetTransOffsetY()); + *data << float(((Player*)this)->GetTransOffsetZ()); + *data << float(((Player*)this)->GetTransOffsetO()); + *data << uint32(((Player*)this)->GetTransTime()); + *data << uint8(((Player*)this)->GetTransSeat()); + } + *data << uint32(0); //fall time } void WorldObject::BuildTeleportAckMsg(WorldPacket *data, float x, float y, float z, float ang) const @@ -1638,6 +1651,16 @@ void WorldObject::BuildTeleportAckMsg(WorldPacket *data, float x, float y, float *data << y; *data << z; *data << ang; + if(GetTypeId() == TYPEID_PLAYER && ((Unit*)this)->hasUnitState(UNIT_STAT_ONVEHICLE)) + { + *data << uint64(((Unit*)this)->GetCharmGUID()); + *data << float(((Player*)this)->GetTransOffsetX()); + *data << float(((Player*)this)->GetTransOffsetY()); + *data << float(((Player*)this)->GetTransOffsetZ()); + *data << float(((Player*)this)->GetTransOffsetO()); + *data << uint32(((Player*)this)->GetTransTime()); + *data << uint8(((Player*)this)->GetTransSeat()); + } *data << uint32(0); } |
