aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MoveThroughVillageGoal.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 17:37:16 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 17:37:16 +0700
commit119bff351450ea16ffda550b6e0f67379b29f708 (patch)
treed9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.World/MoveThroughVillageGoal.cpp
parent8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff)
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/MoveThroughVillageGoal.cpp')
-rw-r--r--Minecraft.World/MoveThroughVillageGoal.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/MoveThroughVillageGoal.cpp b/Minecraft.World/MoveThroughVillageGoal.cpp
index 40acca5d..2405374f 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;
- std::shared_ptr<Village> village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 0);
+ 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;
- std::shared_ptr<DoorInfo> _doorInfo = getNextDoorInfo(village);
+ 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;
- std::shared_ptr<DoorInfo> _doorInfo = doorInfo.lock();
+ 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()
{
- std::shared_ptr<DoorInfo> _doorInfo = doorInfo.lock();
+ 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()
}
}
-std::shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(std::shared_ptr<Village> village)
+shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(shared_ptr<Village> village)
{
- std::shared_ptr<DoorInfo> closest = nullptr;
+ shared_ptr<DoorInfo> closest = nullptr;
int closestDistSqr = Integer::MAX_VALUE;
- vector<std::shared_ptr<DoorInfo> > *doorInfos = village->getDoorInfos();
+ vector<shared_ptr<DoorInfo> > *doorInfos = village->getDoorInfos();
//for (DoorInfo di : doorInfos)
for(AUTO_VAR(it, doorInfos->begin()); it != doorInfos->end(); ++it)
{
- std::shared_ptr<DoorInfo> di = *it;
+ 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 @@ std::shared_ptr<DoorInfo> MoveThroughVillageGoal::getNextDoorInfo(std::shared_pt
return closest;
}
-bool MoveThroughVillageGoal::hasVisited(std::shared_ptr<DoorInfo>di)
+bool MoveThroughVillageGoal::hasVisited(shared_ptr<DoorInfo>di)
{
//for (DoorInfo di2 : visited)
for(AUTO_VAR(it, visited.begin()); it != visited.end(); )
{
- std::shared_ptr<DoorInfo> di2 = (*it).lock();
+ shared_ptr<DoorInfo> di2 = (*it).lock();
if( di2 == NULL )
{
it = visited.erase(it);