X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fnet%2Fnet.cpp;h=fa9c381f15d4961dbf9ae6578c101e408fe99dfd;hb=8ab4ea13545cccbacbd1ed610968d3f481c1b3c8;hp=0f8aa216c42f8c57b1fcfb667ac75216610b7976;hpb=8dc262b12992c7cd8d4bee0fa4114ee3fb6dcd87;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); }