summaryrefslogtreecommitdiff
path: root/src/effectmanager.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:21:43 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-29 14:18:06 +0100
commite7c285e3423ddd660447f6a6fc6bbae25f99f386 (patch)
tree1d700f09a5e96a2a0d390af30581097bdec0bf77 /src/effectmanager.cpp
parente1a7c1d0ca30c2c4a293ffbff6b9c51c881d23e3 (diff)
downloadmana-client-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.gz
mana-client-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.bz2
mana-client-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.xz
mana-client-e7c285e3423ddd660447f6a6fc6bbae25f99f386.zip
Apply C++11 fixits
modernize-loop-convert modernize-deprecated-headers
Diffstat (limited to 'src/effectmanager.cpp')
-rw-r--r--src/effectmanager.cpp24
1 files changed, 12 insertions, 12 deletions
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;
}
}