diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
| commit | 119bff351450ea16ffda550b6e0f67379b29f708 (patch) | |
| tree | d9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.World/NearestAttackableTargetGoal.cpp | |
| parent | 8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff) | |
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.World/NearestAttackableTargetGoal.cpp')
| -rw-r--r-- | Minecraft.World/NearestAttackableTargetGoal.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Minecraft.World/NearestAttackableTargetGoal.cpp b/Minecraft.World/NearestAttackableTargetGoal.cpp index 23bf8d0b..5ed9f4f1 100644 --- a/Minecraft.World/NearestAttackableTargetGoal.cpp +++ b/Minecraft.World/NearestAttackableTargetGoal.cpp @@ -9,7 +9,7 @@ NearestAttackableTargetGoal::DistComp::DistComp(Entity *source) this->source = source; } -bool NearestAttackableTargetGoal::DistComp::operator() (std::shared_ptr<Entity> e1, std::shared_ptr<Entity> e2) +bool NearestAttackableTargetGoal::DistComp::operator() (shared_ptr<Entity> e1, shared_ptr<Entity> e2) { // Should return true if e1 comes before e2 in the sorted list double distSqr1 = source->distanceToSqr(e1); @@ -38,7 +38,7 @@ bool NearestAttackableTargetGoal::canUse() if (randomInterval > 0 && mob->getRandom()->nextInt(randomInterval) != 0) return false; if (targetType == typeid(Player)) { - std::shared_ptr<Mob> potentialTarget = mob->level->getNearestAttackablePlayer(mob->shared_from_this(), within); + shared_ptr<Mob> potentialTarget = mob->level->getNearestAttackablePlayer(mob->shared_from_this(), within); if (canAttack(potentialTarget, false)) { target = weak_ptr<Mob>(potentialTarget); @@ -47,12 +47,12 @@ bool NearestAttackableTargetGoal::canUse() } else { - vector<std::shared_ptr<Entity> > *entities = mob->level->getEntitiesOfClass(targetType, mob->bb->grow(within, 4, within)); + vector<shared_ptr<Entity> > *entities = mob->level->getEntitiesOfClass(targetType, mob->bb->grow(within, 4, within)); //Collections.sort(entities, distComp); std::sort(entities->begin(), entities->end(), *distComp); for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - std::shared_ptr<Mob> potTarget = dynamic_pointer_cast<Mob>(*it); + shared_ptr<Mob> potTarget = dynamic_pointer_cast<Mob>(*it); if (canAttack(potTarget, false)) { target = weak_ptr<Mob>(potTarget); |
