diff options
| author | qwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com> | 2026-03-05 17:17:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-05 17:17:45 -0600 |
| commit | 0666959d312dc74903f55d1071488a90239330f1 (patch) | |
| tree | 5c6886f7ec65a7828bc6e34a469514e418bcf78b /Minecraft.World/ThrownPotion.cpp | |
| parent | 9370cbc7d878df1615d8ce76bc459e8b414d0f19 (diff) | |
| parent | eed770b121aa4ce38f002db042d0137c24c6d344 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/ThrownPotion.cpp')
| -rw-r--r-- | Minecraft.World/ThrownPotion.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Minecraft.World/ThrownPotion.cpp b/Minecraft.World/ThrownPotion.cpp index f99a0ecb..69c096a2 100644 --- a/Minecraft.World/ThrownPotion.cpp +++ b/Minecraft.World/ThrownPotion.cpp @@ -14,7 +14,7 @@ const double ThrownPotion::SPLASH_RANGE = 4.0; const double ThrownPotion::SPLASH_RANGE_SQ = ThrownPotion::SPLASH_RANGE * ThrownPotion::SPLASH_RANGE; void ThrownPotion::_init() -{ +{ // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that // the derived version of the function is called this->defineSynchedData(); @@ -95,11 +95,9 @@ void ThrownPotion::onHit(HitResult *res) if (entitiesOfClass != NULL && !entitiesOfClass->empty()) { - //for (Entity e : entitiesOfClass) - for(AUTO_VAR(it, entitiesOfClass->begin()); it != entitiesOfClass->end(); ++it) + for(auto & it : *entitiesOfClass) { - //shared_ptr<Entity> e = *it; - shared_ptr<LivingEntity> e = dynamic_pointer_cast<LivingEntity>( *it ); + shared_ptr<LivingEntity> e = dynamic_pointer_cast<LivingEntity>( it ); double dist = distanceToSqr(e); if (dist < SPLASH_RANGE_SQ) { @@ -110,9 +108,8 @@ void ThrownPotion::onHit(HitResult *res) } //for (MobEffectInstance effect : mobEffects) - for(AUTO_VAR(itMEI, mobEffects->begin()); itMEI != mobEffects->end(); ++itMEI) + for(auto& effect : *mobEffects) { - MobEffectInstance *effect = *itMEI; int id = effect->getId(); if (MobEffect::effects[id]->isInstantenous()) { |
