From 8da57afa6d36af7fa94403cbde41f1305d611259 Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 9 Apr 2011 01:09:16 +0200 Subject: fix move sound --- pacman-c++/actor.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index 2b65528..a52be15 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp @@ -106,11 +106,6 @@ void Actor::move(Actor::Movement direction) if (isMoving()) return; - if (m_local && AudioPlayer::self()->state() != Phonon::PlayingState) - { - AudioPlayer::self()->play(AudioPlayer::WakaWaka); - } - /* stop current animation */ if (direction != m_direction) { @@ -163,7 +158,13 @@ void Actor::move(Actor::Movement direction) m_eating[direction]->start(); m_direction = direction; } - m_moving->start(); + + if (direction != Actor::None) + { + m_moving->start(); + if (m_local && AudioPlayer::self()->state() != Phonon::PlayingState) + AudioPlayer::self()->play(AudioPlayer::WakaWaka); + } } bool Actor::isMoving() -- cgit v1.2.3