From 7074f35e4ba831e358117842b99ee35b87f85ae5 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:58:20 +0700 Subject: 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. --- Minecraft.World/BreedGoal.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Minecraft.World/BreedGoal.cpp') diff --git a/Minecraft.World/BreedGoal.cpp b/Minecraft.World/BreedGoal.cpp index 2145d371..f9427ccf 100644 --- a/Minecraft.World/BreedGoal.cpp +++ b/Minecraft.World/BreedGoal.cpp @@ -46,13 +46,13 @@ void BreedGoal::tick() if (loveTime == 20 * 3) breed(); } -shared_ptr BreedGoal::getFreePartner() +std::shared_ptr BreedGoal::getFreePartner() { float r = 8; - vector > *others = level->getEntitiesOfClass(typeid(*animal), animal->bb->grow(r, r, r)); + vector > *others = level->getEntitiesOfClass(typeid(*animal), animal->bb->grow(r, r, r)); for(AUTO_VAR(it, others->begin()); it != others->end(); ++it) { - shared_ptr p = dynamic_pointer_cast(*it); + std::shared_ptr p = dynamic_pointer_cast(*it); if (animal->canMate(p)) { delete others; @@ -65,7 +65,7 @@ shared_ptr BreedGoal::getFreePartner() void BreedGoal::breed() { - shared_ptr offspring = animal->getBreedOffspring(partner.lock()); + std::shared_ptr offspring = animal->getBreedOffspring(partner.lock()); animal->setDespawnProtected(); partner.lock()->setDespawnProtected(); if (offspring == NULL) @@ -76,7 +76,7 @@ void BreedGoal::breed() return; } - shared_ptr loveCause = animal->getLoveCause(); + std::shared_ptr loveCause = animal->getLoveCause(); if (loveCause == NULL && partner.lock()->getLoveCause() != NULL) { loveCause = partner.lock()->getLoveCause(); @@ -112,5 +112,5 @@ void BreedGoal::breed() * animal->bbWidth * 2 - animal->bbWidth, xa, ya, za); } // 4J-PB - Fix for 106869- Customer Encountered: TU12: Content: Gameplay: Breeding animals does not give any Experience Orbs. - level->addEntity( shared_ptr( new ExperienceOrb(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1) ) ); + level->addEntity( std::shared_ptr( new ExperienceOrb(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1) ) ); } -- cgit v1.2.3