static constexpr std::uint32_t MAX_ENTITIES = 7;
static constexpr std::size_t GetSize(std::uint32_t num) noexcept {
- return 4 + (num * 64);
+ return 4 + (num * 68);
}
void WriteEntityCount(std::uint32_t) 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);
}