diff options
| author | qwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com> | 2026-03-05 17:17:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-05 17:17:45 -0600 |
| commit | 0666959d312dc74903f55d1071488a90239330f1 (patch) | |
| tree | 5c6886f7ec65a7828bc6e34a469514e418bcf78b /Minecraft.World/StrongholdFeature.cpp | |
| parent | 9370cbc7d878df1615d8ce76bc459e8b414d0f19 (diff) | |
| parent | eed770b121aa4ce38f002db042d0137c24c6d344 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/StrongholdFeature.cpp')
| -rw-r--r-- | Minecraft.World/StrongholdFeature.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.World/StrongholdFeature.cpp b/Minecraft.World/StrongholdFeature.cpp index 3aed0195..fa85dc42 100644 --- a/Minecraft.World/StrongholdFeature.cpp +++ b/Minecraft.World/StrongholdFeature.cpp @@ -53,21 +53,21 @@ StrongholdFeature::StrongholdFeature(unordered_map<wstring, wstring> options) { _init(); - for (AUTO_VAR(it, options.begin()); it != options.end(); ++it) + for (auto& option : options) { - if (it->first.compare(OPTION_DISTANCE) == 0) + if (option.first.compare(OPTION_DISTANCE) == 0) { - distance = Mth::getDouble(it->second, distance, 1); + distance = Mth::getDouble(option.second, distance, 1); } - else if (it->first.compare(OPTION_COUNT) == 0) + else if (option.first.compare(OPTION_COUNT) == 0) { // 4J-JEV: Removed, we only have the one stronghold. //strongholdPos = new ChunkPos[ Mth::getInt(it->second, strongholdPos_length, 1) ]; assert(false); } - else if (it->first.compare(OPTION_SPREAD) == 0) + else if (option.first.compare(OPTION_SPREAD) == 0) { - spread = Mth::getInt(it->second, spread, 1); + spread = Mth::getInt(option.second, spread, 1); } } } @@ -174,7 +174,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat) #ifdef _LARGE_WORLDS angle = random.nextDouble() * PI * 2.0 * circle / (double) spread; #endif - } + } while(!hasFoundValidPos && findAttempts < MAX_STRONGHOLD_ATTEMPTS); if(!hasFoundValidPos) @@ -255,8 +255,8 @@ StrongholdFeature::StrongholdStart::StrongholdStart(Level *level, Random *random while (!pendingChildren->empty()) { int pos = random->nextInt((int)pendingChildren->size()); - AUTO_VAR(it, pendingChildren->begin() + pos); - StructurePiece *structurePiece = *it; + auto it = pendingChildren->begin() + pos; + StructurePiece *structurePiece = *it; pendingChildren->erase(it); structurePiece->addChildren(startRoom, &pieces, random); } |
