From ae9e5750accc13747bbbc532905f37688e815dcf Mon Sep 17 00:00:00 2001 From: Koncord Date: Fri, 2 Jun 2017 17:20:34 +0800 Subject: [PATCH] [General] Aggressive compression of rotations --- .../Packets/Player/PacketPlayerPosition.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/components/openmw-mp/Packets/Player/PacketPlayerPosition.cpp b/components/openmw-mp/Packets/Player/PacketPlayerPosition.cpp index c9c3b0769..1ee45cbde 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerPosition.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerPosition.cpp @@ -19,6 +19,20 @@ void PacketPlayerPosition::Packet(RakNet::BitStream *bs, bool send) { PlayerPacket::Packet(bs, send); - RW(player->position, send, 1); + float rot[2]; + if(send) + { + rot[0] = player->position.rot[0] * 0.1f; + rot[1] = player->position.rot[2] * 0.1f; + } + RW(rot[0], send, 1); + RW(rot[1], send, 1); + if(!send) + { + player->position.rot[0] = rot[0] / 0.1f; + player->position.rot[2] = rot[1] / 0.1f; + } + + RW(player->position.pos, send, 1); RW(player->direction.pos, send, 1); }