diff options
| author | void_17 <61356189+void2012@users.noreply.github.com> | 2026-03-06 02:11:18 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 02:11:18 +0700 |
| commit | 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch) | |
| tree | 953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.World/StrongholdFeature.cpp | |
| parent | 7d6658fe5b3095f35093701b5ab669ffc291e875 (diff) | |
Remove AUTO_VAR macro and _toString function (#592)
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); } |
