Skip to content

Commit

Permalink
Manually set collision height when mounting.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed May 25, 2022
1 parent f8f6aae commit 2de29ff
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions HermesProxy/World/Client/PacketHandlers/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,17 @@ public void StoreObjectUpdate(WowGuid128 guid, ObjectType objectType, BitArray u
if (UNIT_FIELD_MOUNTDISPLAYID >= 0 && updateMaskArray[UNIT_FIELD_MOUNTDISPLAYID])
{
updateData.UnitData.MountDisplayID = updates[UNIT_FIELD_MOUNTDISPLAYID].Int32Value;

if (!isCreate && guid == GetSession().GameState.CurrentPlayerGuid &&
LegacyVersion.RemovedInVersion(ClientVersionBuild.V3_0_2_9056))
{
MoveSetCollisionHeight height = new();
height.MoverGUID = guid;
height.Height = updateData.UnitData.MountDisplayID != 0 ? 3.081099f : 2.438083f;
height.MountDisplayID = (uint)updateData.UnitData.MountDisplayID;
height.Reason = 1; // Mount
SendPacketToClient(height);
}
}
int UNIT_FIELD_MINDAMAGE = LegacyVersion.GetUpdateField(UnitField.UNIT_FIELD_MINDAMAGE);
if (UNIT_FIELD_MINDAMAGE >= 0 && updateMaskArray[UNIT_FIELD_MINDAMAGE])
Expand Down
24 changes: 24 additions & 0 deletions HermesProxy/World/Server/Packets/MovementPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,30 @@ public override void Read()
public MovementAck Ack;
}

class MoveSetCollisionHeight : ServerPacket
{
public MoveSetCollisionHeight() : base(Opcode.SMSG_MOVE_SET_COLLISION_HEIGHT) { }

public override void Write()
{
_worldPacket.WritePackedGuid128(MoverGUID);
_worldPacket.WriteUInt32(SequenceIndex);
_worldPacket.WriteFloat(Height);
_worldPacket.WriteFloat(Scale);
_worldPacket.WriteUInt8(Reason);
_worldPacket.WriteUInt32(MountDisplayID);
_worldPacket.WriteInt32(ScaleDuration);
}

public WowGuid128 MoverGUID;
public uint SequenceIndex = 1;
public float Height = 1.0f;
public float Scale = 1.0f;
public byte Reason;
public uint MountDisplayID;
public int ScaleDuration = 2000;
}

class MoveKnockBack : ServerPacket
{
public MoveKnockBack() : base(Opcode.SMSG_MOVE_KNOCK_BACK, ConnectionType.Instance) { }
Expand Down

0 comments on commit 2de29ff

Please sign in to comment.