diff options
Diffstat (limited to 'Minecraft.World/MoveThroughVillageGoal.cpp')
| -rw-r--r-- | Minecraft.World/MoveThroughVillageGoal.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/MoveThroughVillageGoal.cpp b/Minecraft.World/MoveThroughVillageGoal.cpp index 2405374f..40acca5d 100644 --- a/Minecraft.World/MoveThroughVillageGoal.cpp +++ b/Minecraft.World/MoveThroughVillageGoal.cpp @@ -31,10 +31,10 @@ bool MoveThroughVillageGoal::canUse() if (onlyAtNight && mob->level->isDay()) return false; - shared_ptr<Village> village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 0); + std::shared_ptr<Village> village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 0); if (village == NULL) return false; - shared_ptr<DoorInfo> _doorInfo = getNextDoorInfo(village); + std::shared_ptr<DoorInfo> _doorInfo = getNextDoorInfo(village); if (_doorInfo == NULL) return false; doorInfo = _doorInfo; @@ -59,7 +59,7 @@ bool MoveThroughVillageGoal::canContinueToUse() { if (mob->getNavigation()->isDone()) return false; float dist = mob->bbWidth + 4.f; - shared_ptr<DoorInfo> _doorInfo = doorInfo.lock(); + std::shared_ptr<DoorInfo> _doorInfo = doorInfo.lock(); if( _doorInfo == NULL ) return false; return mob->distanceToSqr(_doorInfo->x, _doorInfo->y, _doorInfo->z) > dist * dist; @@ -73,7 +73,7 @@ void MoveThroughVillageGoal::start() void MoveThroughVillageGoal::stop() { - shared_ptr<DoorInfo> _doorInfo = doorInfo.lock(); + std::shared_ptr<DoorInfo> _doorInfo = doorInfo.lock(); if( _doorInfo == NULL ) return; if (mob->getNavigation()->isDone() || mob->distanceToSqr(_doorInfo->x, _doorInfo->y, _doorInfo->z) < 4 * 4) @@ -82,15 +82,15 @@ void MoveThroughVillageGoal::stop() } } -shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(shared_ptr<Village> village) +std::shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(std::shared_ptr<Village> village) { - shared_ptr<DoorInfo> closest = nullptr; + std::shared_ptr<DoorInfo> closest = nullptr; int closestDistSqr = Integer::MAX_VALUE; - vector<shared_ptr<DoorInfo> > *doorInfos = village->getDoorInfos(); + vector<std::shared_ptr<DoorInfo> > *doorInfos = village->getDoorInfos(); //for (DoorInfo di : doorInfos) for(AUTO_VAR(it, doorInfos->begin()); it != doorInfos->end(); ++it) { - shared_ptr<DoorInfo> di = *it; + std::shared_ptr<DoorInfo> di = *it; int distSqr = di->distanceToSqr(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); if (distSqr < closestDistSqr) { @@ -102,12 +102,12 @@ shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(shared_ptr<Village> return closest; } -bool MoveThroughVillageGoal::hasVisited(shared_ptr<DoorInfo>di) +bool MoveThroughVillageGoal::hasVisited(std::shared_ptr<DoorInfo>di) { //for (DoorInfo di2 : visited) for(AUTO_VAR(it, visited.begin()); it != visited.end(); ) { - shared_ptr<DoorInfo> di2 = (*it).lock(); + std::shared_ptr<DoorInfo> di2 = (*it).lock(); if( di2 == NULL ) { it = visited.erase(it); |
