From 4edbdf124303f0e7c229f43a5054755e112ff6b4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 14 Nov 2015 18:02:03 +0300 Subject: Fix attack sprite actions. Add ride attack action. --- src/being/being.cpp | 7 +++++-- src/being/being.h | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index dd06c918d..5a4da79fc 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1309,7 +1309,7 @@ std::string Being::getMoveAction() const std::string Being::getWeaponAttackAction(const ItemInfo *const weapon) const { if (!weapon) - return SpriteAction::ATTACK; + return getAttackAction(); if (mHorseId != 0) return weapon->getRideAttackAction(); @@ -1327,8 +1327,10 @@ std::string Being::getWeaponAttackAction(const ItemInfo *const weapon) const std::string Being::getAttackAction(const Attack *const attack1) const { if (!attack1) - return SpriteAction::ATTACK; + return getAttackAction(); + if (mHorseId != 0) + return attack1->mRideAction; if (mMap) { const unsigned char mask = mMap->getBlockMask(mX, mY); @@ -1356,6 +1358,7 @@ std::string Being::getAttackAction(const Attack *const attack1) const return SpriteAction::action; \ } +getSpriteAction(Attack, ATTACK) getSpriteAction(Dead, DEAD) getSpriteAction(Spawn, SPAWN) getSpriteAction(Cast, CAST) diff --git a/src/being/being.h b/src/being/being.h index 9c9fd6ade..a31f39be5 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -607,9 +607,13 @@ class Being notfinal : public ActorSprite, std::string getSpawnAction() const A_WARN_UNUSED; - std::string getWeaponAttackAction(const ItemInfo *const weapon) const; + std::string getWeaponAttackAction(const ItemInfo *const weapon) const + A_WARN_UNUSED; - std::string getAttackAction(const Attack *const attack) const; + std::string getAttackAction() const A_WARN_UNUSED; + + std::string getAttackAction(const Attack *const attack) const + A_WARN_UNUSED; /** * Whether or not this player is a GM. -- cgit v1.2.3-60-g2f50