[General] Get rid Z axis in direction.pos

This commit is contained in:
Koncord 2017-06-02 18:33:59 +08:00
parent a847d46984
commit dded330cc4

View file

@ -27,12 +27,19 @@ void PacketPlayerPosition::Packet(RakNet::BitStream *bs, bool send)
}
RW(rot[0], send, 1);
RW(rot[1], send, 1);
RW(player->position.pos, send, 1);
RW(player->direction.pos[0], send, 1);
RW(player->direction.pos[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);
if(abs(player->direction.pos[0]) < 1)
player->direction.pos[0] = 0;
if(abs(player->direction.pos[1]) < 1)
player->direction.pos[1] = 0;
}
}