summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being/actorsprite.h19
-rw-r--r--src/being/being.cpp8
2 files changed, 17 insertions, 10 deletions
diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h
index 12624aa30..e0c64b017 100644
--- a/src/being/actorsprite.h
+++ b/src/being/actorsprite.h
@@ -177,7 +177,7 @@ class ActorSprite notfinal : public CompoundSprite, public Actor
bool getHaveCart() const A_WARN_UNUSED
{ return mHaveCart; }
- virtual void setRiding(const bool b)
+ void setRiding(const bool b)
{ mRiding = b; }
protected:
@@ -207,15 +207,6 @@ class ActorSprite notfinal : public CompoundSprite, public Actor
const int imageType = 0,
const std::string &color = "");
- std::set<int> mStatusEffects; /**< set of active status effects */
-
- ParticleList mStunParticleEffects;
- ParticleVector mStatusParticleEffects;
- ParticleList mChildParticleEffects;
- int mId;
- uint16_t mStunMode; /**< Stun mode; zero if not stunned */
-
- private:
/** Load the target cursors into memory */
static void initTargetCursor();
@@ -228,6 +219,14 @@ class ActorSprite notfinal : public CompoundSprite, public Actor
static bool loaded;
+ std::set<int> mStatusEffects; /**< set of active status effects */
+
+ ParticleList mStunParticleEffects;
+ ParticleVector mStatusParticleEffects;
+ ParticleList mChildParticleEffects;
+ int mId;
+ uint16_t mStunMode; /**< Stun mode; zero if not stunned */
+
/** Target cursor being used */
AnimatedSprite *mUsedTargetCursor;
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); \