From 698620d703fea6d572c967bfa746d475d28f2d81 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sun, 23 May 2010 19:09:14 -0600 Subject: Fix attack display for beings without an attack defined Reviewed-by: 4144 --- src/being.cpp | 9 ++------- src/resources/beinginfo.cpp | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2