dynamic_pointer_cast -> std::dynamic_pointer_cast
This commit is contained in:
@@ -33,7 +33,7 @@ bool AvoidPlayerGoal::canUse()
|
||||
{
|
||||
if (avoidType == typeid(Player))
|
||||
{
|
||||
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()) return false;
|
||||
toAvoid = weak_ptr<Entity>(mob->level->getNearestPlayer(mob->shared_from_this(), maxDist));
|
||||
if (toAvoid.lock() == NULL) return false;
|
||||
@@ -52,7 +52,7 @@ bool AvoidPlayerGoal::canUse()
|
||||
|
||||
if (!mob->getSensing()->canSee(toAvoid.lock())) return false;
|
||||
|
||||
Vec3 *pos = RandomPos::getPosAvoid(dynamic_pointer_cast<PathfinderMob>(mob->shared_from_this()), 16, 7, Vec3::newTemp(toAvoid.lock()->x, toAvoid.lock()->y, toAvoid.lock()->z));
|
||||
Vec3 *pos = RandomPos::getPosAvoid(std::dynamic_pointer_cast<PathfinderMob>(mob->shared_from_this()), 16, 7, Vec3::newTemp(toAvoid.lock()->x, toAvoid.lock()->y, toAvoid.lock()->z));
|
||||
if (pos == NULL) return false;
|
||||
if (toAvoid.lock()->distanceToSqr(pos->x, pos->y, pos->z) < toAvoid.lock()->distanceToSqr(mob->shared_from_this())) return false;
|
||||
delete path;
|
||||
|
||||
Reference in New Issue
Block a user