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/EnderDragon.cpp | |
| parent | 7bee4770df1540c2daf3121c0790332fb41e72dd (diff) | |
dynamic_pointer_cast -> std::dynamic_pointer_cast
Diffstat (limited to 'Minecraft.World/EnderDragon.cpp')
| -rw-r--r-- | Minecraft.World/EnderDragon.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.World/EnderDragon.cpp b/Minecraft.World/EnderDragon.cpp index d93dc3bd..7ecd6a3b 100644 --- a/Minecraft.World/EnderDragon.cpp +++ b/Minecraft.World/EnderDragon.cpp @@ -444,7 +444,7 @@ void EnderDragon::aiStep() for( AUTO_VAR(it, targets->begin() ); it != targets->end(); ++it) { - std::shared_ptr<Mob> e = dynamic_pointer_cast<Mob>( *it ); + std::shared_ptr<Mob> e = std::dynamic_pointer_cast<Mob>( *it ); if (e != NULL) { //app.DebugPrintf("Attacking entity with acid\n"); @@ -734,7 +734,7 @@ void EnderDragon::aiStep() double zdd = attackTarget->z - startingZ; level->levelEvent(nullptr, LevelEvent::SOUND_GHAST_FIREBALL, (int) x, (int) y, (int) z, 0); - std::shared_ptr<DragonFireball> ie = std::shared_ptr<DragonFireball>( new DragonFireball(level, dynamic_pointer_cast<Mob>( shared_from_this() ), xdd, ydd, zdd) ); + std::shared_ptr<DragonFireball> ie = std::shared_ptr<DragonFireball>( new DragonFireball(level, std::dynamic_pointer_cast<Mob>( shared_from_this() ), xdd, ydd, zdd) ); ie->x = startingX; ie->y = startingY; ie->z = startingZ; @@ -800,7 +800,7 @@ void EnderDragon::checkCrystals() //for (Entity ec : crystals) for(AUTO_VAR(it, crystals->begin()); it != crystals->end(); ++it) { - std::shared_ptr<EnderCrystal> ec = dynamic_pointer_cast<EnderCrystal>( *it ); + std::shared_ptr<EnderCrystal> ec = std::dynamic_pointer_cast<EnderCrystal>( *it ); double dist = ec->distanceToSqr(shared_from_this() ); if (dist < nearest) { @@ -840,7 +840,7 @@ void EnderDragon::knockBack(vector<std::shared_ptr<Entity> > *entities) //for (Entity e : entities) for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - std::shared_ptr<Mob> e = dynamic_pointer_cast<Mob>( *it ); + std::shared_ptr<Mob> e = std::dynamic_pointer_cast<Mob>( *it ); if (e != NULL)//(e instanceof Mob) { double xd = e->x - xm; @@ -856,10 +856,10 @@ void EnderDragon::hurt(vector<std::shared_ptr<Entity> > *entities) //for (int i = 0; i < entities->size(); i++) for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - std::shared_ptr<Mob> e = dynamic_pointer_cast<Mob>( *it );//entities.get(i); + std::shared_ptr<Mob> e = std::dynamic_pointer_cast<Mob>( *it );//entities.get(i); if (e != NULL) //(e instanceof Mob) { - DamageSource *damageSource = DamageSource::mobAttack( dynamic_pointer_cast<Mob>( shared_from_this() )); + DamageSource *damageSource = DamageSource::mobAttack( std::dynamic_pointer_cast<Mob>( shared_from_this() )); e->hurt(damageSource, 10); delete damageSource; } @@ -1116,7 +1116,7 @@ bool EnderDragon::hurt(std::shared_ptr<BossMobPart> bossMobPart, DamageSource *s //zTarget = z - cc1 * 5 + (random->nextFloat() - 0.5f) * 2; //attackTarget = NULL; - if (source == DamageSource::explosion || (dynamic_pointer_cast<Player>(source->getEntity()) != NULL)) + if (source == DamageSource::explosion || (std::dynamic_pointer_cast<Player>(source->getEntity()) != NULL)) { int healthBefore = health; reallyHurt(source, damage); @@ -1461,11 +1461,11 @@ void EnderDragon::handleCrystalDestroyed(DamageSource *source) #endif } } - else if(dynamic_pointer_cast<Player>(source->getEntity()) != NULL) + else if(std::dynamic_pointer_cast<Player>(source->getEntity()) != NULL) { if(setSynchedAction(e_EnderdragonAction_StrafePlayer)) { - attackTarget = dynamic_pointer_cast<Player>(source->getEntity()); + attackTarget = std::dynamic_pointer_cast<Player>(source->getEntity()); #if PRINT_DRAGON_STATE_CHANGE_MESSAGES app.DebugPrintf("Dragon action is now: StrafePlayer\n"); #endif |
