diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-20 09:40:13 +0100 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-20 09:40:13 +0100 |
commit | 6d1038669a9a188015f7a19aed41084d8752891c (patch) | |
tree | 89f953ee40fb16876f83dd3c27627ed64abbcd1b | |
parent | Cleanup Linux build flags (diff) | |
download | AltCraft-6d1038669a9a188015f7a19aed41084d8752891c.tar AltCraft-6d1038669a9a188015f7a19aed41084d8752891c.tar.gz AltCraft-6d1038669a9a188015f7a19aed41084d8752891c.tar.bz2 AltCraft-6d1038669a9a188015f7a19aed41084d8752891c.tar.lz AltCraft-6d1038669a9a188015f7a19aed41084d8752891c.tar.xz AltCraft-6d1038669a9a188015f7a19aed41084d8752891c.tar.zst AltCraft-6d1038669a9a188015f7a19aed41084d8752891c.zip |
-rw-r--r-- | src/GameState.cpp | 4 | ||||
-rw-r--r-- | src/Section.cpp | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/GameState.cpp b/src/GameState.cpp index a2f7d87..de9f1d7 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -52,11 +52,11 @@ void GameState::UpdatePacket(std::shared_ptr<Packet> ptr) case SpawnGlobalEntity: break; case SpawnMob: { - auto packet = std::static_pointer_cast<PacketSpawnObject>(ptr); + auto packet = std::static_pointer_cast<PacketSpawnMob>(ptr); Entity entity; entity.entityId = packet->EntityId; entity.pos = VectorF(packet->X, packet->Y, packet->Z); - entity.uuid = packet->ObjectUuid; + entity.uuid = packet->EntityUuid; entity.vel = Entity::DecodeVelocity(packet->VelocityX, packet->VelocityY, packet->VelocityZ); entity.yaw = packet->Yaw / 256.0; entity.pitch = packet->Pitch / 256.0; diff --git a/src/Section.cpp b/src/Section.cpp index 1083538..2f72411 100644 --- a/src/Section.cpp +++ b/src/Section.cpp @@ -4,6 +4,12 @@ #include <cstring> void Section::CalculateHash() const { + if (block.empty()) { + hash = 0; + return; + } + + size_t offset = 0; std::vector<unsigned char> rawData; |