summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/being.cpp b/src/being.cpp
index f1a3e0169..a9aade448 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -1004,6 +1004,20 @@ void Being::fireMissile(Being *victim, const std::string &particle)
}
+std::string Being::getSitAction() const
+{
+ if (serverVersion < 0)
+ {
+ return SpriteAction::SIT;
+ }
+ else
+ {
+ if (mMap && !mMap->getWalk(mX, mY, Map::BLOCKMASK_GROUNDTOP))
+ return SpriteAction::SITTOP;
+ return SpriteAction::SIT;
+ }
+}
+
void Being::setAction(Action action, int attackType A_UNUSED)
{
std::string currentAction = SpriteAction::INVALID;
@@ -1019,9 +1033,16 @@ void Being::setAction(Action action, int attackType A_UNUSED)
// while using only the ACTION_MOVE.
break;
case SIT:
- currentAction = SpriteAction::SIT;
+ currentAction = getSitAction();
if (mInfo)
- sound.playSfx(mInfo->getSound(SOUND_EVENT_SIT), mX, mY);
+ {
+ SoundEvent event;
+ if (currentAction == SpriteAction::SITTOP)
+ event = SOUND_EVENT_SITTOP;
+ else
+ event = SOUND_EVENT_SIT;
+ sound.playSfx(mInfo->getSound(event), mX, mY);
+ }
break;
case ATTACK:
if (mEquippedWeapon)