diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-27 18:48:37 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-02-02 15:27:56 +0100 |
commit | 7cc504d993fa948ae2e10848993f4552b2d6daaa (patch) | |
tree | 4d3b583fa8a9f732c0b71f3905e821a297e9a000 /src/resources/beinginfo.cpp | |
parent | 2e70a4a4412f44934b3d2055c5b46c441dd0d132 (diff) | |
download | mana-7cc504d993fa948ae2e10848993f4552b2d6daaa.tar.gz mana-7cc504d993fa948ae2e10848993f4552b2d6daaa.tar.bz2 mana-7cc504d993fa948ae2e10848993f4552b2d6daaa.tar.xz mana-7cc504d993fa948ae2e10848993f4552b2d6daaa.zip |
Fixed the use of custom particle effects for attacks.
The tA beingmanager was wrongly using the attack type
in the Being::handleAttack() function,
which is in fact used to set the attack id.
Thus, breaking the attack id given
and all its attack parameters.
I noticed that while updating the client data for TMW.
Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/resources/beinginfo.cpp')
-rw-r--r-- | src/resources/beinginfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index 33af8980..8683e7bc 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -99,16 +99,17 @@ const Attack *BeingInfo::getAttack(int id) const paths.getIntValue("criticalHitEffectId"), std::string()); - Attacks::const_iterator i = mAttacks.find(id); - return (i == mAttacks.end()) ? empty : (*i).second; + Attacks::const_iterator it = mAttacks.find(id); + return (it == mAttacks.end()) ? empty : it->second; } void BeingInfo::addAttack(int id, std::string action, int effectId, int hitEffectId, int criticalHitEffectId, const std::string &missileParticleFilename) { - if (mAttacks[id]) - delete mAttacks[id]; + Attacks::iterator it = mAttacks.find(id); + if (it != mAttacks.end()) + delete it->second; mAttacks[id] = new Attack(action, effectId, hitEffectId, criticalHitEffectId, missileParticleFilename); |