summaryrefslogtreecommitdiff
path: root/src/effectmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/effectmanager.cpp')
-rw-r--r--src/effectmanager.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index 97dd53ff..5ac1dd5a 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -32,10 +32,14 @@ EffectManager::EffectManager()
XML::Document doc("effects.xml");
xmlNodePtr root = doc.rootNode();
- if (!root || !xmlStrEqual(root->name, BAD_CAST "being-effects"))
+ if (!root || !xmlStrEqual(root->name, BAD_CAST "effects"))
{
- logger->log("Error loading being effects file: effects.xml");
- return;
+ // Handle old naming until the 0.5.x versions are obsolete.
+ if (!root || !xmlStrEqual(root->name, BAD_CAST "being-effects"))
+ {
+ logger->log("Error loading being effects file: effects.xml");
+ return;
+ }
}
else
{
@@ -59,7 +63,7 @@ EffectManager::~EffectManager()
{
}
-bool EffectManager::trigger(int id, Being* being)
+bool EffectManager::trigger(int id, Being* being, int rotation)
{
bool rValue = false;
for (std::list<EffectDescription>::iterator i = mEffects.begin(); i != mEffects.end(); ++i)
@@ -70,7 +74,7 @@ bool EffectManager::trigger(int id, Being* being)
if (!(*i).GFX.empty())
{
Particle *selfFX;
- selfFX = particleEngine->addEffect((*i).GFX, 0, 0);
+ selfFX = particleEngine->addEffect((*i).GFX, 0, 0, rotation);
being->controlParticle(selfFX);
}
if (!(*i).SFX.empty())
@@ -81,7 +85,7 @@ bool EffectManager::trigger(int id, Being* being)
return rValue;
}
-bool EffectManager::trigger(int id, int x, int y)
+bool EffectManager::trigger(int id, int x, int y, int rotation)
{
bool rValue = false;
for (std::list<EffectDescription>::iterator i = mEffects.begin(); i != mEffects.end(); ++i)
@@ -90,7 +94,7 @@ bool EffectManager::trigger(int id, int x, int y)
{
rValue = true;
if (!(*i).GFX.empty())
- particleEngine->addEffect((*i).GFX, x, y);
+ particleEngine->addEffect((*i).GFX, x, y, rotation);
if (!(*i).SFX.empty())
sound.playSfx((*i).SFX);
break;