aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/BreedGoal.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/BreedGoal.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/BreedGoal.cpp')
-rw-r--r--Minecraft.World/BreedGoal.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.World/BreedGoal.cpp b/Minecraft.World/BreedGoal.cpp
index 10aa6844..1c46fd90 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() != nullptr;
+ return partner.lock() != NULL;
}
bool BreedGoal::canContinueToUse()
{
- return partner.lock() != nullptr && partner.lock()->isAlive() && partner.lock()->isInLove() && loveTime < 20 * 3;
+ return partner.lock() != NULL && 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 == nullptr)
+ if (offspring == NULL)
{
- // 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
+ // 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
animal->resetLove();
partner.lock()->resetLove();
return;
}
shared_ptr<Player> loveCause = animal->getLoveCause();
- if (loveCause == nullptr && partner.lock()->getLoveCause() != nullptr)
+ if (loveCause == NULL && partner.lock()->getLoveCause() != NULL)
{
loveCause = partner.lock()->getLoveCause();
}
- if (loveCause != nullptr)
+ if (loveCause != NULL)
{
// 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(std::make_shared<ExperienceOrb>(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1));
+ level->addEntity( shared_ptr<ExperienceOrb>( new ExperienceOrb(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1) ) );
}