diff options
| author | qwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com> | 2026-03-16 21:44:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-16 21:44:26 -0500 |
| commit | ce739f6045ec72127491286ea3f3f21e537c1b55 (patch) | |
| tree | f33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.World/BreedGoal.cpp | |
| parent | 255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff) | |
| parent | 5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/BreedGoal.cpp')
| -rw-r--r-- | Minecraft.World/BreedGoal.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.World/BreedGoal.cpp b/Minecraft.World/BreedGoal.cpp index 1c46fd90..10aa6844 100644 --- a/Minecraft.World/BreedGoal.cpp +++ b/Minecraft.World/BreedGoal.cpp @@ -25,12 +25,12 @@ bool BreedGoal::canUse() { if (!animal->isInLove()) return false; partner = weak_ptr<Animal>(getFreePartner()); - return partner.lock() != NULL; + return partner.lock() != nullptr; } bool BreedGoal::canContinueToUse() { - return partner.lock() != NULL && partner.lock()->isAlive() && partner.lock()->isInLove() && loveTime < 20 * 3; + return partner.lock() != nullptr && partner.lock()->isAlive() && partner.lock()->isInLove() && loveTime < 20 * 3; } void BreedGoal::stop() @@ -74,21 +74,21 @@ void BreedGoal::breed() shared_ptr<AgableMob> offspring = animal->getBreedOffspring(partner.lock()); animal->setDespawnProtected(); partner.lock()->setDespawnProtected(); - if (offspring == NULL) + if (offspring == nullptr) { - // This will be NULL if we've hit our limits for spawning any particular type of animal... reset things as normally as we can, without actually producing any offspring + // This will be nullptr if we've hit our limits for spawning any particular type of animal... reset things as normally as we can, without actually producing any offspring animal->resetLove(); partner.lock()->resetLove(); return; } shared_ptr<Player> loveCause = animal->getLoveCause(); - if (loveCause == NULL && partner.lock()->getLoveCause() != NULL) + if (loveCause == nullptr && partner.lock()->getLoveCause() != nullptr) { loveCause = partner.lock()->getLoveCause(); } - if (loveCause != NULL) + if (loveCause != nullptr) { // Record mob bred stat. loveCause->awardStat(GenericStats::breedEntity(offspring->GetType()),GenericStats::param_breedEntity(offspring->GetType())); @@ -118,5 +118,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<ExperienceOrb>( new ExperienceOrb(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1) ) ); + level->addEntity(std::make_shared<ExperienceOrb>(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1)); } |
