diff options
| author | void_17 <61356189+void2012@users.noreply.github.com> | 2026-03-06 02:11:18 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 02:11:18 +0700 |
| commit | 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch) | |
| tree | 953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.World/ThrownPotion.cpp | |
| parent | 7d6658fe5b3095f35093701b5ab669ffc291e875 (diff) | |
Remove AUTO_VAR macro and _toString function (#592)
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()) { |
