summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-03 18:26:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-03 18:26:17 +0300
commit975f12cdaa4bba66c0e1e18aa3d638f3ae8cad76 (patch)
tree2a0fa752d8bb9c044142fdabd00386fd09b14a75 /src/being/being.cpp
parent7f299fa18a883f5e7392b00764aa1c4d2c41b212 (diff)
downloadmv-975f12cdaa4bba66c0e1e18aa3d638f3ae8cad76.tar.gz
mv-975f12cdaa4bba66c0e1e18aa3d638f3ae8cad76.tar.bz2
mv-975f12cdaa4bba66c0e1e18aa3d638f3ae8cad76.tar.xz
mv-975f12cdaa4bba66c0e1e18aa3d638f3ae8cad76.zip
Use riding sprite actions in being.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index e8ab55736..62eded545 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -1112,6 +1112,8 @@ void Being::fireMissile(Being *const victim, const std::string &particle) const
std::string Being::getSitAction() const
{
+ if (mRiding)
+ return SpriteAction::SITRIDE;
if (mMap)
{
const unsigned char mask = mMap->getBlockMask(mX, mY);
@@ -1128,6 +1130,8 @@ std::string Being::getSitAction() const
std::string Being::getMoveAction() const
{
+ if (mRiding)
+ return SpriteAction::RIDE;
if (mMap)
{
const unsigned char mask = mMap->getBlockMask(mX, mY);
@@ -1144,6 +1148,8 @@ std::string Being::getWeaponAttackAction(const ItemInfo *const weapon) const
if (!weapon)
return SpriteAction::ATTACK;
+ if (mRiding)
+ return weapon->getRideAttackAction();
if (mMap)
{
const unsigned char mask = mMap->getBlockMask(mX, mY);
@@ -1174,6 +1180,8 @@ std::string Being::getAttackAction(const Attack *const attack1) const
#define getSpriteAction(func, action) \
std::string Being::get##func##Action() const \
{ \
+ if (mRiding) \
+ return SpriteAction::action##RIDE; \
if (mMap) \
{ \
const unsigned char mask = mMap->getBlockMask(mX, mY); \