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

@@ -12,7 +12,7 @@ UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() {
;
m_health = 0;
m_food = 0;
m_spawnPos = NULL;
m_spawnPos = nullptr;
m_yRot = 0.0f;
}
@@ -60,7 +60,7 @@ void UpdatePlayerRuleDefinition::getChildren(
GameRuleDefinition* UpdatePlayerRuleDefinition::addChild(
ConsoleGameRules::EGameRuleType ruleType) {
GameRuleDefinition* rule = NULL;
GameRuleDefinition* rule = nullptr;
if (ruleType == ConsoleGameRules::eGameRuleType_AddItem) {
rule = new AddItemRuleDefinition();
m_items.push_back((AddItemRuleDefinition*)rule);
@@ -78,19 +78,19 @@ GameRuleDefinition* UpdatePlayerRuleDefinition::addChild(
void UpdatePlayerRuleDefinition::addAttribute(
const std::wstring& attributeName, const std::wstring& attributeValue) {
if (attributeName.compare(L"spawnX") == 0) {
if (m_spawnPos == NULL) m_spawnPos = new Pos();
if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = _fromString<int>(attributeValue);
m_spawnPos->x = value;
app.DebugPrintf(
"UpdatePlayerRuleDefinition: Adding parameter spawnX=%d\n", value);
} else if (attributeName.compare(L"spawnY") == 0) {
if (m_spawnPos == NULL) m_spawnPos = new Pos();
if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = _fromString<int>(attributeValue);
m_spawnPos->y = value;
app.DebugPrintf(
"UpdatePlayerRuleDefinition: Adding parameter spawnY=%d\n", value);
} else if (attributeName.compare(L"spawnZ") == 0) {
if (m_spawnPos == NULL) m_spawnPos = new Pos();
if (m_spawnPos == nullptr) m_spawnPos = new Pos();
int value = _fromString<int>(attributeValue);
m_spawnPos->z = value;
app.DebugPrintf(
@@ -134,7 +134,7 @@ void UpdatePlayerRuleDefinition::postProcessPlayer(
double z = player->z;
float yRot = player->yRot;
float xRot = player->xRot;
if (m_spawnPos != NULL) {
if (m_spawnPos != nullptr) {
x = m_spawnPos->x;
y = m_spawnPos->y;
z = m_spawnPos->z;
@@ -144,7 +144,7 @@ void UpdatePlayerRuleDefinition::postProcessPlayer(
yRot = m_yRot;
}
if (m_spawnPos != NULL || m_bUpdateYRot)
if (m_spawnPos != nullptr || m_bUpdateYRot)
player->absMoveTo(x, y, z, yRot, xRot);
for (AUTO_VAR(it, m_items.begin()); it != m_items.end(); ++it) {