From 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Fri, 6 Mar 2026 02:11:18 +0700 Subject: Remove AUTO_VAR macro and _toString function (#592) --- Minecraft.World/MoveThroughVillageGoal.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/MoveThroughVillageGoal.cpp') diff --git a/Minecraft.World/MoveThroughVillageGoal.cpp b/Minecraft.World/MoveThroughVillageGoal.cpp index d4cdde94..f112c109 100644 --- a/Minecraft.World/MoveThroughVillageGoal.cpp +++ b/Minecraft.World/MoveThroughVillageGoal.cpp @@ -87,10 +87,8 @@ shared_ptr MoveThroughVillageGoal::getNextDoorInfo(shared_ptr shared_ptr closest = nullptr; int closestDistSqr = Integer::MAX_VALUE; vector > *doorInfos = village->getDoorInfos(); - //for (DoorInfo di : doorInfos) - for(AUTO_VAR(it, doorInfos->begin()); it != doorInfos->end(); ++it) + for(auto& di : *doorInfos) { - shared_ptr di = *it; int distSqr = di->distanceToSqr(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); if (distSqr < closestDistSqr) { @@ -104,11 +102,10 @@ shared_ptr MoveThroughVillageGoal::getNextDoorInfo(shared_ptr bool MoveThroughVillageGoal::hasVisited(shared_ptrdi) { - //for (DoorInfo di2 : visited) - for(AUTO_VAR(it, visited.begin()); it != visited.end(); ) - { + for (auto it = visited.begin(); it != visited.end();) + { shared_ptr di2 = (*it).lock(); - if( di2 == NULL ) + if( di2 ) { it = visited.erase(it); } -- cgit v1.2.3