diff --git a/src/items/powerup.cpp b/src/items/powerup.cpp index 2c1a6bb56..4f8a5ec71 100644 --- a/src/items/powerup.cpp +++ b/src/items/powerup.cpp @@ -166,7 +166,16 @@ void Powerup::use() kart->attach(ATTACH_ANVIL, stk_config->m_anvil_time); kart->updatedWeight(); kart->adjustSpeed(stk_config->m_anvil_speed_factor*0.5f); - m_sound_use->position(m_owner->getXYZ()); + + // should we position the sound at the kart that is hit, + // or the kart "throwing" the anvil? Ideally it should be both. + // Meanwhile, don't play it near AI karts since they obviously + // don't hear anything + if(kart->isPlayerKart()) + m_sound_use->position(kart->getXYZ()); + else + m_sound_use->position(m_owner->getXYZ()); + m_sound_use->play(); break; } @@ -193,11 +202,15 @@ void Powerup::use() } } - if(player_kart) - { + // should we position the sound at the kart that is hit, + // or the kart "throwing" the anvil? Ideally it should be both. + // Meanwhile, don't play it near AI karts since they obviously + // don't hear anything + if(m_owner->isPlayerKart()) + m_sound_use->position(m_owner->getXYZ()); + else if(player_kart) m_sound_use->position(player_kart->getXYZ()); - m_sound_use->play(); - } + m_sound_use->play(); } break;