diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 17:10:34 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 17:10:34 +0700 |
| commit | 07ad68bc156b3ab70401723bb074a29588ad3cb7 (patch) | |
| tree | fcd5c35bb393920e46af6c9b643d0544e78b5ab8 /Minecraft.World/TargetGoal.cpp | |
| parent | 7bee4770df1540c2daf3121c0790332fb41e72dd (diff) | |
dynamic_pointer_cast -> std::dynamic_pointer_cast
Diffstat (limited to 'Minecraft.World/TargetGoal.cpp')
| -rw-r--r-- | Minecraft.World/TargetGoal.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Minecraft.World/TargetGoal.cpp b/Minecraft.World/TargetGoal.cpp index 28102c60..8f6eaa47 100644 --- a/Minecraft.World/TargetGoal.cpp +++ b/Minecraft.World/TargetGoal.cpp @@ -69,16 +69,16 @@ bool TargetGoal::canAttack(std::shared_ptr<Mob> target, bool allowInvulnerable) if (!target->isAlive()) return false; if (!mob->canAttackType(target->GetType())) return false; - std::shared_ptr<TamableAnimal> tamableAnimal = dynamic_pointer_cast<TamableAnimal>(mob->shared_from_this()); + std::shared_ptr<TamableAnimal> tamableAnimal = std::dynamic_pointer_cast<TamableAnimal>(mob->shared_from_this()); if (tamableAnimal != NULL && tamableAnimal->isTame()) { - std::shared_ptr<TamableAnimal> tamableTarget = dynamic_pointer_cast<TamableAnimal>(target); + std::shared_ptr<TamableAnimal> tamableTarget = std::dynamic_pointer_cast<TamableAnimal>(target); if (tamableTarget != NULL && tamableTarget->isTame()) return false; if (target == tamableAnimal->getOwner()) return false; } - else if (dynamic_pointer_cast<Player>(target) != NULL) + else if (std::dynamic_pointer_cast<Player>(target) != NULL) { - if (!allowInvulnerable && (dynamic_pointer_cast<Player>(target))->abilities.invulnerable) return false; + if (!allowInvulnerable && (std::dynamic_pointer_cast<Player>(target))->abilities.invulnerable) return false; } if (!mob->isWithinRestriction(Mth::floor(target->x), Mth::floor(target->y), Mth::floor(target->z))) return false; |
