mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Movement
* Implemented a generic way of sending movement packets depending on who controls the unit (player or server controlled) * Added possibility to specify extra elements in movement packets (such as speed, extra passenger guid, collision height and similar) without having to add a special element only for these * Removed Unit::SendMovementFlagUpdate as it was something working only in 3.3.5a and earlier (no serverside HEARTBEAT opcode exists now)
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "MovementStructures.h"
|
||||
|
||||
void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
@@ -425,28 +426,19 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData)
|
||||
uint32 opcode = recvData.GetOpcode();
|
||||
|
||||
/* extract packet */
|
||||
uint64 guid;
|
||||
uint32 unk1;
|
||||
float newspeed;
|
||||
|
||||
recvData.readPackGUID(guid);
|
||||
MovementInfo movementInfo;
|
||||
static MovementStatusElements const speedElement = MSEExtraFloat;
|
||||
Movement::ExtraMovementStatusElement extras(&speedElement);
|
||||
GetPlayer()->ReadMovementInfo(recvData, &movementInfo, &extras);
|
||||
|
||||
// now can skip not our packet
|
||||
if (_player->GetGUID() != guid)
|
||||
if (_player->GetGUID() != movementInfo.guid)
|
||||
{
|
||||
recvData.rfinish(); // prevent warnings spam
|
||||
return;
|
||||
}
|
||||
|
||||
// continue parse packet
|
||||
|
||||
recvData >> unk1; // counter or moveEvent
|
||||
|
||||
MovementInfo movementInfo;
|
||||
movementInfo.guid = guid;
|
||||
GetPlayer()->ReadMovementInfo(recvData, &movementInfo);
|
||||
|
||||
recvData >> newspeed;
|
||||
float newspeed = extras.Data.floatData;
|
||||
/*----------------*/
|
||||
|
||||
// client ACK send one packet for mounted/run case and need skip all except last from its
|
||||
@@ -615,3 +607,13 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData)
|
||||
|
||||
_player->SummonIfPossible(agree);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetCollisionHeightAck(WorldPacket& recvPacket)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_SET_COLLISION_HEIGHT_ACK");
|
||||
|
||||
static MovementStatusElements const heightElement = MSEExtraFloat;
|
||||
Movement::ExtraMovementStatusElement extra(&heightElement);
|
||||
MovementInfo movementInfo;
|
||||
GetPlayer()->ReadMovementInfo(recvPacket, &movementInfo, &extra);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user