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 a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

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