refactor: replace NULL with nullptr across C++ codebase

Excludes vendored C libs (zlib, Miles, DirectXMath, boost, Iggy).
This commit is contained in:
MatthewBeshay
2026-03-30 16:25:52 +11:00
parent a330ecdcbb
commit dfb0e3b03e
752 changed files with 5396 additions and 5396 deletions

View File

@@ -149,7 +149,7 @@ void MultiplayerLocalPlayer::sendPosition() {
bool move = (xdd * xdd + ydd1 * ydd1 + zdd * zdd) > 0.03 * 0.03 ||
positionReminder >= POSITION_REMINDER_INTERVAL;
bool rot = rydd != 0 || rxdd != 0;
if (riding != NULL) {
if (riding != nullptr) {
connection->send(
std::shared_ptr<MovePlayerPacket>(new MovePlayerPacket::PosRot(
xd, -999, -999, zd, yRot, xRot, onGround, abilities.flying)));
@@ -221,7 +221,7 @@ void MultiplayerLocalPlayer::actuallyHurt(DamageSource* source, float dmg) {
// 4J Added override to capture event for tutorial messages
void MultiplayerLocalPlayer::completeUsingItem() {
Minecraft* pMinecraft = Minecraft::GetInstance();
if (useItem != NULL && pMinecraft->localgameModes[m_iPad] != NULL) {
if (useItem != nullptr && pMinecraft->localgameModes[m_iPad] != nullptr) {
TutorialMode* gameMode =
(TutorialMode*)pMinecraft->localgameModes[m_iPad];
Tutorial* tutorial = gameMode->getTutorial();
@@ -232,7 +232,7 @@ void MultiplayerLocalPlayer::completeUsingItem() {
void MultiplayerLocalPlayer::onEffectAdded(MobEffectInstance* effect) {
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft->localgameModes[m_iPad] != NULL) {
if (pMinecraft->localgameModes[m_iPad] != nullptr) {
TutorialMode* gameMode =
(TutorialMode*)pMinecraft->localgameModes[m_iPad];
Tutorial* tutorial = gameMode->getTutorial();
@@ -244,7 +244,7 @@ void MultiplayerLocalPlayer::onEffectAdded(MobEffectInstance* effect) {
void MultiplayerLocalPlayer::onEffectUpdated(MobEffectInstance* effect,
bool doRefreshAttributes) {
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft->localgameModes[m_iPad] != NULL) {
if (pMinecraft->localgameModes[m_iPad] != nullptr) {
TutorialMode* gameMode =
(TutorialMode*)pMinecraft->localgameModes[m_iPad];
Tutorial* tutorial = gameMode->getTutorial();
@@ -255,7 +255,7 @@ void MultiplayerLocalPlayer::onEffectUpdated(MobEffectInstance* effect,
void MultiplayerLocalPlayer::onEffectRemoved(MobEffectInstance* effect) {
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft->localgameModes[m_iPad] != NULL) {
if (pMinecraft->localgameModes[m_iPad] != nullptr) {
TutorialMode* gameMode =
(TutorialMode*)pMinecraft->localgameModes[m_iPad];
Tutorial* tutorial = gameMode->getTutorial();
@@ -287,7 +287,7 @@ void MultiplayerLocalPlayer::hurtTo(float newHealth,
}
void MultiplayerLocalPlayer::awardStat(Stat* stat, byteArray param) {
if (stat == NULL) {
if (stat == nullptr) {
delete[] param.data;
return;
}
@@ -301,7 +301,7 @@ void MultiplayerLocalPlayer::awardStat(Stat* stat, byteArray param) {
}
void MultiplayerLocalPlayer::awardStatFromServer(Stat* stat, byteArray param) {
if (stat != NULL && !stat->awardLocallyOnly) {
if (stat != nullptr && !stat->awardLocallyOnly) {
LocalPlayer::awardStat(stat, param);
} else
delete[] param.data;
@@ -328,9 +328,9 @@ void MultiplayerLocalPlayer::sendOpenInventory() {
}
void MultiplayerLocalPlayer::ride(std::shared_ptr<Entity> e) {
bool wasRiding = riding != NULL;
bool wasRiding = riding != nullptr;
LocalPlayer::ride(e);
bool isRiding = riding != NULL;
bool isRiding = riding != nullptr;
// 4J Added
if (wasRiding && !isRiding) {
@@ -340,7 +340,7 @@ void MultiplayerLocalPlayer::ride(std::shared_ptr<Entity> e) {
if (isRiding) {
ETelemetryChallenges eventType = eTelemetryChallenges_Unknown;
if (this->riding != NULL) {
if (this->riding != nullptr) {
switch (riding->GetType()) {
case eTYPE_BOAT:
eventType = eTelemetryInGame_Ride_Boat;
@@ -363,7 +363,7 @@ void MultiplayerLocalPlayer::ride(std::shared_ptr<Entity> e) {
Minecraft* pMinecraft = Minecraft::GetInstance();
if (pMinecraft->localgameModes[m_iPad] != NULL) {
if (pMinecraft->localgameModes[m_iPad] != nullptr) {
TutorialMode* gameMode =
(TutorialMode*)pMinecraft->localgameModes[m_iPad];
if (wasRiding && !isRiding) {