From fdf6db5fd6ba56cc4cb1993b0ca8153a890c769f Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 27 Jun 2011 23:26:01 +0200 Subject: fixed that music resets on password prompt. Closes #695 --- src/game/client/components/sounds.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/game/client/components/sounds.cpp') diff --git a/src/game/client/components/sounds.cpp b/src/game/client/components/sounds.cpp index 4e9ef5b5..c4ade00e 100644 --- a/src/game/client/components/sounds.cpp +++ b/src/game/client/components/sounds.cpp @@ -65,8 +65,17 @@ void CSounds::OnInit() void CSounds::OnReset() { - Sound()->StopAll(); - ClearQueue(); + if(Client()->State() >= IClient::STATE_ONLINE) + { + Sound()->StopAll(); + ClearQueue(); + } +} + +void CSounds::OnStateChange(int NewState, int OldState) +{ + if(NewState == IClient::STATE_ONLINE || NewState == IClient::STATE_DEMOPLAYBACK) + OnReset(); } void CSounds::OnRender() -- cgit 1.4.1