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.
This commit is contained in:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -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();
}