aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StrongholdFeature.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/StrongholdFeature.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/StrongholdFeature.cpp')
-rw-r--r--Minecraft.World/StrongholdFeature.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/StrongholdFeature.cpp b/Minecraft.World/StrongholdFeature.cpp
index 83f05cf3..fa85dc42 100644
--- a/Minecraft.World/StrongholdFeature.cpp
+++ b/Minecraft.World/StrongholdFeature.cpp
@@ -39,7 +39,7 @@ void StrongholdFeature::_init()
// 4J added initialisers
for (int i = 0; i < strongholdPos_length; i++)
{
- strongholdPos[i] = nullptr;
+ strongholdPos[i] = NULL;
}
isSpotSelected = false;
}
@@ -136,11 +136,11 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
}
#endif
- int selectedX = static_cast<int>(Math::round(cos(angle) * dist));
- int selectedZ = static_cast<int>(Math::round(sin(angle) * dist));
+ int selectedX = (int) (Math::round(cos(angle) * dist));
+ int selectedZ = (int) (Math::round(sin(angle) * dist));
TilePos *position = level->getBiomeSource()->findBiome((selectedX << 4) + 8, (selectedZ << 4) + 8, 7 << 4, allowedBiomes, &random);
- if (position != nullptr)
+ if (position != NULL)
{
selectedX = position->x >> 4;
selectedZ = position->z >> 4;
@@ -164,7 +164,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
delete strongholdPos[i];
strongholdPos[i] = new ChunkPos(selectedX, selectedZ);
- angle += PI * 2.0 / static_cast<double>(strongholdPos_length);
+ angle += PI * 2.0 / (double) strongholdPos_length;
}
// 4J Stu - We want to make sure that we have at least one stronghold in this world
@@ -172,7 +172,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
// 4J Stu - Randomise the angles for retries as well
#ifdef _LARGE_WORLDS
- angle = random.nextDouble() * PI * 2.0 * circle / static_cast<double>(spread);
+ angle = random.nextDouble() * PI * 2.0 * circle / (double) spread;
#endif
}
while(!hasFoundValidPos && findAttempts < MAX_STRONGHOLD_ATTEMPTS);
@@ -191,7 +191,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
{
bool forcePlacement = false;
LevelGenerationOptions *levelGenOptions = app.getLevelGenerationOptions();
- if( levelGenOptions != nullptr )
+ if( levelGenOptions != NULL )
{
forcePlacement = levelGenOptions->isFeatureChunk(x,z,eFeature_Stronghold);
}
@@ -211,7 +211,7 @@ vector<TilePos> *StrongholdFeature::getGuesstimatedFeaturePositions()
for( int i = 0; i < strongholdPos_length; i++ )
{
ChunkPos *chunkPos = strongholdPos[i];
- if (chunkPos != nullptr)
+ if (chunkPos != NULL)
{
positions->push_back(chunkPos->getMiddleBlockPosition(64));
}
@@ -225,7 +225,7 @@ StructureStart *StrongholdFeature::createStructureStart(int x, int z)
StrongholdStart *start = new StrongholdStart(level, random, x, z);
// 4J - front() was get(0)
- while (start->getPieces()->empty() || static_cast<StrongholdPieces::StartPiece *>(start->getPieces()->front())->portalRoomPiece == nullptr)
+ while (start->getPieces()->empty() || ((StrongholdPieces::StartPiece *) start->getPieces()->front())->portalRoomPiece == NULL)
{
delete start;
// regenerate stronghold without changing seed
@@ -254,7 +254,7 @@ StrongholdFeature::StrongholdStart::StrongholdStart(Level *level, Random *random
vector<StructurePiece *> *pendingChildren = &startRoom->pendingChildren;
while (!pendingChildren->empty())
{
- int pos = random->nextInt(static_cast<int>(pendingChildren->size()));
+ int pos = random->nextInt((int)pendingChildren->size());
auto it = pendingChildren->begin() + pos;
StructurePiece *structurePiece = *it;
pendingChildren->erase(it);