aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/RestrictOpenDoorGoal.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
commit7074f35e4ba831e358117842b99ee35b87f85ae5 (patch)
tree7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/RestrictOpenDoorGoal.cpp
parentd63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff)
shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
Diffstat (limited to 'Minecraft.World/RestrictOpenDoorGoal.cpp')
-rw-r--r--Minecraft.World/RestrictOpenDoorGoal.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Minecraft.World/RestrictOpenDoorGoal.cpp b/Minecraft.World/RestrictOpenDoorGoal.cpp
index e8620a71..2849aabc 100644
--- a/Minecraft.World/RestrictOpenDoorGoal.cpp
+++ b/Minecraft.World/RestrictOpenDoorGoal.cpp
@@ -13,9 +13,9 @@ RestrictOpenDoorGoal::RestrictOpenDoorGoal(PathfinderMob *mob)
bool RestrictOpenDoorGoal::canUse()
{
if (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), 16);
+ std::shared_ptr<Village> village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 16);
if (village == NULL) return false;
- shared_ptr<DoorInfo> _doorInfo = village->getClosestDoorInfo(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z));
+ std::shared_ptr<DoorInfo> _doorInfo = village->getClosestDoorInfo(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z));
if (_doorInfo == NULL) return false;
doorInfo = _doorInfo;
return _doorInfo->distanceToInsideSqr(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)) < 1.5 * 1.5;
@@ -24,7 +24,7 @@ bool RestrictOpenDoorGoal::canUse()
bool RestrictOpenDoorGoal::canContinueToUse()
{
if (mob->level->isDay()) return false;
- shared_ptr<DoorInfo> _doorInfo = doorInfo.lock();
+ std::shared_ptr<DoorInfo> _doorInfo = doorInfo.lock();
if ( _doorInfo == NULL ) return false;
return !_doorInfo->removed && _doorInfo->isInsideSide(Mth::floor(mob->x), Mth::floor(mob->z));
}
@@ -44,6 +44,6 @@ void RestrictOpenDoorGoal::stop()
void RestrictOpenDoorGoal::tick()
{
- shared_ptr<DoorInfo> _doorInfo = doorInfo.lock();
+ std::shared_ptr<DoorInfo> _doorInfo = doorInfo.lock();
if ( _doorInfo ) _doorInfo->incBookingCount();
} \ No newline at end of file