aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MoveThroughVillageGoal.cpp
diff options
context:
space:
mode:
authorvoid_17 <61356189+void2012@users.noreply.github.com>2026-03-06 02:11:18 +0700
committerGitHub <noreply@github.com>2026-03-06 02:11:18 +0700
commit55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch)
tree953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.World/MoveThroughVillageGoal.cpp
parent7d6658fe5b3095f35093701b5ab669ffc291e875 (diff)
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.World/MoveThroughVillageGoal.cpp')
-rw-r--r--Minecraft.World/MoveThroughVillageGoal.cpp11
1 files changed, 4 insertions, 7 deletions
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<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(shared_ptr<Village>
shared_ptr<DoorInfo> closest = nullptr;
int closestDistSqr = Integer::MAX_VALUE;
vector<shared_ptr<DoorInfo> > *doorInfos = village->getDoorInfos();
- //for (DoorInfo di : doorInfos)
- for(AUTO_VAR(it, doorInfos->begin()); it != doorInfos->end(); ++it)
+ for(auto& di : *doorInfos)
{
- shared_ptr<DoorInfo> 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<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(shared_ptr<Village>
bool MoveThroughVillageGoal::hasVisited(shared_ptr<DoorInfo>di)
{
- //for (DoorInfo di2 : visited)
- for(AUTO_VAR(it, visited.begin()); it != visited.end(); )
- {
+ for (auto it = visited.begin(); it != visited.end();)
+ {
shared_ptr<DoorInfo> di2 = (*it).lock();
- if( di2 == NULL )
+ if( di2 )
{
it = visited.erase(it);
}