summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/tmwa/beinghandler.cpp5
-rw-r--r--src/resources/beinginfo.cpp9
2 files changed, 7 insertions, 7 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index b74ab3e7..bcfb335f 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -361,7 +361,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
if (dstBeing)
dstBeing->takeDamage(srcBeing, param1, Being::HIT); // Perhaps a new skill attack type should be created and used?
if (srcBeing)
- srcBeing->handleAttack(dstBeing, param1, Being::HIT);
+ srcBeing->handleAttack(dstBeing, param1);
break;
}
case SMSG_BEING_ACTION:
@@ -386,8 +386,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
dstBeing->takeDamage(srcBeing, param1,
(Being::AttackType)type);
if (srcBeing)
- srcBeing->handleAttack(dstBeing, param1,
- (Being::AttackType)type);
+ srcBeing->handleAttack(dstBeing, param1);
break;
case 0x02: // Sit
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);