aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/NearestAttackableTargetGoal.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/NearestAttackableTargetGoal.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/NearestAttackableTargetGoal.cpp')
-rw-r--r--Minecraft.World/NearestAttackableTargetGoal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Minecraft.World/NearestAttackableTargetGoal.cpp b/Minecraft.World/NearestAttackableTargetGoal.cpp
index c6b75481..7ddd8895 100644
--- a/Minecraft.World/NearestAttackableTargetGoal.cpp
+++ b/Minecraft.World/NearestAttackableTargetGoal.cpp
@@ -18,7 +18,7 @@ SubselectEntitySelector::~SubselectEntitySelector()
bool SubselectEntitySelector::matches(shared_ptr<Entity> entity) const
{
if (!entity->instanceof(eTYPE_LIVINGENTITY)) return false;
- if (m_subselector != nullptr && !m_subselector->matches(entity)) return false;
+ if (m_subselector != NULL && !m_subselector->matches(entity)) return false;
return m_parent->canAttack(dynamic_pointer_cast<LivingEntity>(entity), false);
}
@@ -37,7 +37,7 @@ bool NearestAttackableTargetGoal::DistComp::operator() (shared_ptr<Entity> e1, s
return false;
}
-NearestAttackableTargetGoal::NearestAttackableTargetGoal(PathfinderMob *mob, const type_info& targetType, int randomInterval, bool mustSee, bool mustReach /*= false*/, EntitySelector *entitySelector /* =nullptr */)
+NearestAttackableTargetGoal::NearestAttackableTargetGoal(PathfinderMob *mob, const type_info& targetType, int randomInterval, bool mustSee, bool mustReach /*= false*/, EntitySelector *entitySelector /* =NULL */)
: TargetGoal(mob, mustSee, mustReach), targetType(targetType)
{
this->randomInterval = randomInterval;
@@ -61,7 +61,7 @@ bool NearestAttackableTargetGoal::canUse()
vector<shared_ptr<Entity> > *entities = mob->level->getEntitiesOfClass(targetType, mob->bb->grow(within, 4, within), selector);
bool result = false;
- if(entities != nullptr && !entities->empty() )
+ if(entities != NULL && !entities->empty() )
{
std::sort(entities->begin(), entities->end(), *distComp);
target = weak_ptr<LivingEntity>(dynamic_pointer_cast<LivingEntity>(entities->at(0)));