diff options
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/being.cpp b/src/being.cpp index 2e2c68283..a18f28ae3 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -865,6 +865,8 @@ void Being::setAction(Action action, int attackType _UNUSED_) switch (action) { case MOVE: + if (mInfo) + sound.playSfx(mInfo->getSound(SOUND_EVENT_MOVE), mX, mY); currentAction = SpriteAction::MOVE; // Note: When adding a run action, // Differentiate walk and run with action name, @@ -872,6 +874,8 @@ void Being::setAction(Action action, int attackType _UNUSED_) break; case SIT: currentAction = SpriteAction::SIT; + if (mInfo) + sound.playSfx(mInfo->getSound(SOUND_EVENT_SIT), mX, mY); break; case ATTACK: if (mEquippedWeapon) @@ -919,6 +923,8 @@ void Being::setAction(Action action, int attackType _UNUSED_) break; case HURT: + if (mInfo) + sound.playSfx(mInfo->getSound(SOUND_EVENT_HURT), mX, mY); //currentAction = SpriteAction::HURT;// Buggy: makes the player stop // attacking and unable to attack // again until he moves. @@ -932,6 +938,11 @@ void Being::setAction(Action action, int attackType _UNUSED_) case STAND: currentAction = SpriteAction::STAND; break; + case SPAWN: + if (mInfo) + sound.playSfx(mInfo->getSound(SOUND_EVENT_SPAWN), mX, mY); + currentAction = SpriteAction::SPAWN; + break; default: logger->log("Being::setAction unknown action: " + toString(static_cast<unsigned>(action))); |