aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/AddPlayerPacket.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/AddPlayerPacket.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (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/AddPlayerPacket.cpp')
-rw-r--r--Minecraft.World/AddPlayerPacket.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/AddPlayerPacket.cpp b/Minecraft.World/AddPlayerPacket.cpp
index fbee1fc5..93984367 100644
--- a/Minecraft.World/AddPlayerPacket.cpp
+++ b/Minecraft.World/AddPlayerPacket.cpp
@@ -24,12 +24,12 @@ AddPlayerPacket::AddPlayerPacket()
m_capeId = 0;
m_uiGamePrivileges = 0;
entityData = nullptr;
- unpack = nullptr;
+ unpack = NULL;
}
AddPlayerPacket::~AddPlayerPacket()
{
- if(unpack != nullptr) delete unpack;
+ if(unpack != NULL) delete unpack;
}
AddPlayerPacket::AddPlayerPacket(shared_ptr<Player> player, PlayerUID xuid, PlayerUID OnlineXuid,int xp, int yp, int zp, int yRotp, int xRotp, int yHeadRotp)
@@ -51,17 +51,17 @@ AddPlayerPacket::AddPlayerPacket(shared_ptr<Player> player, PlayerUID xuid, Play
//printf("%d: New add player (%f,%f,%f) : (%d,%d,%d) : xRot %d, yRot %d\n",id,player->x,player->y,player->z,x,y,z,xRot,yRot);
shared_ptr<ItemInstance> itemInstance = player->inventory->getSelected();
- carriedItem = itemInstance == nullptr ? 0 : itemInstance->id;
+ carriedItem = itemInstance == NULL ? 0 : itemInstance->id;
this->xuid = xuid;
this->OnlineXuid = OnlineXuid;
- m_playerIndex = static_cast<BYTE>(player->getPlayerIndex());
+ m_playerIndex = (BYTE)player->getPlayerIndex();
m_skinId = player->getCustomSkin();
m_capeId = player->getCustomCape();
m_uiGamePrivileges = player->getAllPlayerGamePrivileges();
entityData = player->getEntityData();
- unpack = nullptr;
+ unpack = NULL;
}
void AddPlayerPacket::read(DataInputStream *dis) //throws IOException
@@ -119,11 +119,11 @@ int AddPlayerPacket::getEstimatedSize()
{
int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(BYTE) + sizeof(BYTE) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(BYTE) + sizeof(unsigned int) + sizeof(byte);
- if( entityData != nullptr )
+ if( entityData != NULL )
{
iSize += entityData->getSizeInBytes();
}
- else if( unpack != nullptr )
+ else if( unpack != NULL )
{
// 4J Stu - This is an incoming value which we aren't currently analysing
//iSize += unpack->get
@@ -134,7 +134,7 @@ int AddPlayerPacket::getEstimatedSize()
vector<shared_ptr<SynchedEntityData::DataItem> > *AddPlayerPacket::getUnpackedData()
{
- if (unpack == nullptr)
+ if (unpack == NULL)
{
unpack = entityData->getAll();
}