summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-05-23 19:09:14 -0600
committerJared Adams <jaxad0127@gmail.com>2010-05-23 19:20:09 -0600
commit698620d703fea6d572c967bfa746d475d28f2d81 (patch)
tree84569e4a66e0b502f3177308765be646f3b8c35d /src
parent54fb1e339796db4b75560b024a96c6b84a70d89f (diff)
downloadmana-698620d703fea6d572c967bfa746d475d28f2d81.tar.gz
mana-698620d703fea6d572c967bfa746d475d28f2d81.tar.bz2
mana-698620d703fea6d572c967bfa746d475d28f2d81.tar.xz
mana-698620d703fea6d572c967bfa746d475d28f2d81.zip
Fix attack display for beings without an attack defined
Reviewed-by: 4144
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp9
-rw-r--r--src/resources/beinginfo.cpp2
2 files changed, 3 insertions, 8 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 24f2e2e1..fd3561ae 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -370,13 +370,8 @@ void Being::handleAttack(Being *victim, int damage, AttackType type)
if (this != player_node)
setAction(Being::ATTACK, 1);
- if (getType() == PLAYER && victim)
- {
- if (mEquippedWeapon)
- {
- fireMissile(victim, mEquippedWeapon->getMissileParticle());
- }
- }
+ if (getType() == PLAYER && victim && mEquippedWeapon)
+ fireMissile(victim, mEquippedWeapon->getMissileParticle());
else
fireMissile(victim, mInfo->getAttack(mAttackType)->missileParticle);
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index 66addde9..c9447283 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -90,7 +90,7 @@ const std::string &BeingInfo::getSound(SoundEvent event) const
const Attack *BeingInfo::getAttack(int type) const
{
- static Attack *empty = new Attack(ACTION_DEFAULT, "", "");
+ static Attack *empty = new Attack(ACTION_ATTACK, "", "");
Attacks::const_iterator i = mAttacks.find(type);
return (i == mAttacks.end()) ? empty : (*i).second;