From e7c285e3423ddd660447f6a6fc6bbae25f99f386 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 26 Jan 2024 16:21:43 +0100 Subject: Apply C++11 fixits modernize-loop-convert modernize-deprecated-headers --- src/effectmanager.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/effectmanager.cpp') diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index 4fd7d7e6..5de0b872 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -67,19 +67,19 @@ EffectManager::~EffectManager() bool EffectManager::trigger(int id, Being* being, int rotation) { bool rValue = false; - for (auto i = mEffects.begin(); i != mEffects.end(); ++i) + for (auto &effect : mEffects) { - if ((*i).id == id) + if (effect.id == id) { rValue = true; - if (!(*i).GFX.empty()) + if (!effect.GFX.empty()) { Particle *selfFX; - selfFX = particleEngine->addEffect((*i).GFX, 0, 0, rotation); + selfFX = particleEngine->addEffect(effect.GFX, 0, 0, rotation); being->controlParticle(selfFX); } - if (!(*i).SFX.empty()) - sound.playSfx((*i).SFX); + if (!effect.SFX.empty()) + sound.playSfx(effect.SFX); break; } } @@ -89,15 +89,15 @@ bool EffectManager::trigger(int id, Being* being, int rotation) bool EffectManager::trigger(int id, int x, int y, int rotation) { bool rValue = false; - for (auto i = mEffects.begin(); i != mEffects.end(); ++i) + for (auto &effect : mEffects) { - if ((*i).id == id) + if (effect.id == id) { rValue = true; - if (!(*i).GFX.empty()) - particleEngine->addEffect((*i).GFX, x, y, rotation); - if (!(*i).SFX.empty()) - sound.playSfx((*i).SFX); + if (!effect.GFX.empty()) + particleEngine->addEffect(effect.GFX, x, y, rotation); + if (!effect.SFX.empty()) + sound.playSfx(effect.SFX); break; } } -- cgit v1.2.3-60-g2f50