diff options
Diffstat (limited to 'Minecraft.World/RespawnPacket.cpp')
| -rw-r--r-- | Minecraft.World/RespawnPacket.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Minecraft.World/RespawnPacket.cpp b/Minecraft.World/RespawnPacket.cpp index 5c04bbeb..6dbebfac 100644 --- a/Minecraft.World/RespawnPacket.cpp +++ b/Minecraft.World/RespawnPacket.cpp @@ -5,21 +5,21 @@ #include "RespawnPacket.h" #include "LevelType.h" -RespawnPacket::RespawnPacket() +RespawnPacket::RespawnPacket() { this->dimension = 0; this->difficulty = 1; this->mapSeed = 0; this->mapHeight = 0; - this->playerGameType = NULL; + this->playerGameType = nullptr; this->m_newSeaLevel = false; - m_pLevelType = NULL; + m_pLevelType = nullptr; m_newEntityId = 0; m_xzSize = LEVEL_MAX_WIDTH; m_hellScale = HELL_LEVEL_MAX_SCALE; } -RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) +RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) { this->dimension = dimension; this->mapSeed = mapSeed; @@ -35,7 +35,7 @@ RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, Gam } -void RespawnPacket::handle(PacketListener *listener) +void RespawnPacket::handle(PacketListener *listener) { listener->handleRespawn(shared_from_this()); } @@ -47,7 +47,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException mapHeight = dis->readShort(); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == NULL) + if (m_pLevelType == nullptr) { m_pLevelType = LevelType::lvl_normal; } @@ -63,16 +63,16 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException } -void RespawnPacket::write(DataOutputStream *dos) //throws IOException +void RespawnPacket::write(DataOutputStream *dos) //throws IOException { dos->writeByte(dimension); dos->writeByte(playerGameType->getId()); dos->writeShort(mapHeight); - if (m_pLevelType == NULL) + if (m_pLevelType == nullptr) { writeUtf(L"", dos); - } - else + } + else { writeUtf(m_pLevelType->getGeneratorName(), dos); } @@ -86,12 +86,12 @@ void RespawnPacket::write(DataOutputStream *dos) //throws IOException #endif } -int RespawnPacket::getEstimatedSize() +int RespawnPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != NULL) + if (m_pLevelType != nullptr) { - length = (int)m_pLevelType->getGeneratorName().length(); + length = static_cast<int>(m_pLevelType->getGeneratorName().length()); } return 13+length; } |
