X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fnet%2Fnet.cpp;fp=src%2Fnet%2Fnet.cpp;h=fa9c381f15d4961dbf9ae6578c101e408fe99dfd;hb=d635b2f08a2c3fe483d095dae04ad7ed5bd968d8;hp=0f8aa216c42f8c57b1fcfb667ac75216610b7976;hpb=b127256b13f5a07ec6170b333c6dd0c46531cf21;p=blank.git diff --git a/src/net/net.cpp b/src/net/net.cpp index 0f8aa21..fa9c381 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -351,18 +351,19 @@ void Packet::EntityUpdate::ReadEntityCount(uint32_t &count) const noexcept { } void Packet::EntityUpdate::WriteEntity(const Entity &entity, uint32_t num) noexcept { - uint32_t off = 4 + (num * 64); + uint32_t off = GetSize(num);; Write(entity.ID(), off); Write(entity.GetState(), off + 4); } void Packet::EntityUpdate::ReadEntityID(uint32_t &id, uint32_t num) const noexcept { - Read(id, 4 + (num * 64)); + uint32_t off = GetSize(num);; + Read(id, off); } void Packet::EntityUpdate::ReadEntityState(EntityState &state, uint32_t num) const noexcept { - uint32_t off = 4 + (num * 64); + uint32_t off = GetSize(num);; Read(state, off + 4); }