diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-07 21:12:22 -0600 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-07 21:12:22 -0600 |
| commit | 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch) | |
| tree | 69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/AddMobPacket.cpp | |
| parent | a9be52c41a02d207233199e98898fe7483d7e817 (diff) | |
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/AddMobPacket.cpp')
| -rw-r--r-- | Minecraft.World/AddMobPacket.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.World/AddMobPacket.cpp b/Minecraft.World/AddMobPacket.cpp index d5ccfe08..878e2ee7 100644 --- a/Minecraft.World/AddMobPacket.cpp +++ b/Minecraft.World/AddMobPacket.cpp @@ -17,7 +17,7 @@ AddMobPacket::AddMobPacket() yRot = 0; xRot = 0; entityData = nullptr; - unpack = nullptr; + unpack = NULL; } AddMobPacket::~AddMobPacket() @@ -29,7 +29,7 @@ AddMobPacket::AddMobPacket(shared_ptr<LivingEntity> mob, int yRotp, int xRotp, i { id = mob->entityId; - type = static_cast<byte>(EntityIO::getId(mob)); + type = (byte) EntityIO::getId(mob); // 4J Stu - We should add entities at their "last sent" position so that the relative update packets // put them in the correct place x = xp;//Mth::floor(mob->x * 32); @@ -54,14 +54,14 @@ AddMobPacket::AddMobPacket(shared_ptr<LivingEntity> mob, int yRotp, int xRotp, i if (xd > m) xd = m; if (yd > m) yd = m; if (zd > m) zd = m; - this->xd = static_cast<int>(xd * 8000.0); - this->yd = static_cast<int>(yd * 8000.0); - this->zd = static_cast<int>(zd * 8000.0); + this->xd = (int) (xd * 8000.0); + this->yd = (int) (yd * 8000.0); + this->zd = (int) (zd * 8000.0); // printf("%d: New add mob rot %d\n",id,yRot); entityData = mob->getEntityData(); - unpack = nullptr; + unpack = NULL; } void AddMobPacket::read(DataInputStream *dis) //throws IOException @@ -118,11 +118,11 @@ void AddMobPacket::handle(PacketListener *listener) int AddMobPacket::getEstimatedSize() { int size = 11; - if( entityData != nullptr ) + if( entityData != NULL ) { size += entityData->getSizeInBytes(); } - else if( unpack != nullptr ) + else if( unpack != NULL ) { // 4J Stu - This is an incoming value which we aren't currently analysing //size += unpack->get @@ -132,7 +132,7 @@ int AddMobPacket::getEstimatedSize() vector<shared_ptr<SynchedEntityData::DataItem> > *AddMobPacket::getUnpackedData() { - if (unpack == nullptr) + if (unpack == NULL) { unpack = entityData->getAll(); } |
