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/MoveThroughVillageGoal.cpp | |
| parent | 9370cbc7d878df1615d8ce76bc459e8b414d0f19 (diff) | |
| parent | eed770b121aa4ce38f002db042d0137c24c6d344 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/MoveThroughVillageGoal.cpp')
| -rw-r--r-- | Minecraft.World/MoveThroughVillageGoal.cpp | 11 |
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); } |
