Skip to content

Commit

Permalink
Now trader voice will be played from his actual position
Browse files Browse the repository at this point in the history
Thanks to @abramcumner
  • Loading branch information
Xottab-DUTY committed Mar 31, 2019
1 parent 9f40a9a commit 339548f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions cs/engine/xrGame/ai/trader/trader_animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void CTraderAnimation::set_sound(LPCSTR sound, LPCSTR anim)

m_sound = new ref_sound();
m_sound->create (sound,st_Effect,SOUND_TYPE_WORLD);
m_sound->play (NULL, sm_2D);
m_sound->play (m_trader);
}

void CTraderAnimation::remove_sound()
Expand All @@ -87,9 +87,17 @@ void CTraderAnimation::remove_sound()
//////////////////////////////////////////////////////////////////////////
void CTraderAnimation::update_frame()
{
if (m_sound && !m_sound->_feedback()) {
m_trader->callback (GameObject::eTraderSoundEnd)();
remove_sound ();
if (m_sound)
{
if (m_sound->_feedback())
{
m_sound->set_position(m_trader->Position());
}
else
{
m_trader->callback(GameObject::eTraderSoundEnd)();
remove_sound();
}
}


Expand All @@ -115,7 +123,7 @@ void CTraderAnimation::external_sound_start(LPCSTR phrase)

m_sound = new ref_sound();
m_sound->create (phrase,st_Effect,SOUND_TYPE_WORLD);
m_sound->play (NULL, sm_2D);
m_sound->play (m_trader);

m_motion_head.invalidate();
}
Expand Down

0 comments on commit 339548f

Please sign in to comment.