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/PortalForcer.cpp | |
| parent | 7d6658fe5b3095f35093701b5ab669ffc291e875 (diff) | |
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.World/PortalForcer.cpp')
| -rw-r--r-- | Minecraft.World/PortalForcer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.World/PortalForcer.cpp b/Minecraft.World/PortalForcer.cpp index 8880399e..b3850807 100644 --- a/Minecraft.World/PortalForcer.cpp +++ b/Minecraft.World/PortalForcer.cpp @@ -19,9 +19,9 @@ PortalForcer::PortalForcer(ServerLevel *level) PortalForcer::~PortalForcer() { - for(AUTO_VAR(it,cachedPortals.begin()); it != cachedPortals.end(); ++it) + for(auto& it : cachedPortals) { - delete it->second; + delete it.second; } } @@ -96,8 +96,8 @@ bool PortalForcer::findPortal(shared_ptr<Entity> e, double xOriginal, double yOr long hash = ChunkPos::hashCode(xc, zc); bool updateCache = true; - AUTO_VAR(it, cachedPortals.find(hash)); - if (it != cachedPortals.end()) + auto it = cachedPortals.find(hash); + if (it != cachedPortals.end()) { PortalPosition *pos = it->second; @@ -271,7 +271,7 @@ bool PortalForcer::createPortal(shared_ptr<Entity> e) int XZSIZE = level->dimension->getXZSize() * 16; // XZSize is chunks, convert to blocks int XZOFFSET = (XZSIZE / 2) - 4; // Subtract 4 to stay away from the edges // TODO Make the 4 a constant in HellRandomLevelSource - // Move the positions that we want to check away from the edge of the world + // Move the positions that we want to check away from the edge of the world if( (xc - r) < -XZOFFSET ) { app.DebugPrintf("Adjusting portal creation x due to being too close to the edge\n"); @@ -339,7 +339,7 @@ bool PortalForcer::createPortal(shared_ptr<Entity> e) int yt = y + h; int zt = z + (s - 1) * za - b * xa; - // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock + // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock if( ( xt < -XZOFFSET ) || ( xt >= XZOFFSET ) || ( zt < -XZOFFSET ) || ( zt >= XZOFFSET ) ) { app.DebugPrintf("Skipping possible portal location as at least one block is too close to the edge\n"); @@ -399,7 +399,7 @@ next_first: continue; int yt = y + h; int zt = z + (s - 1) * za; - // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock + // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock if( ( xt < -XZOFFSET ) || ( xt >= XZOFFSET ) || ( zt < -XZOFFSET ) || ( zt >= XZOFFSET ) ) { app.DebugPrintf("Skipping possible portal location as at least one block is too close to the edge\n"); @@ -508,8 +508,8 @@ void PortalForcer::tick(__int64 time) { __int64 cutoff = time - SharedConstants::TICKS_PER_SECOND * 30; - for(AUTO_VAR(it,cachedPortalKeys.begin()); it != cachedPortalKeys.end();) - { + for (auto it = cachedPortalKeys.begin(); it != cachedPortalKeys.end();) + { __int64 key = *it; PortalPosition *pos = cachedPortals[key]; |
