From 0036a07ce7bb34c86f25e7b1c4a28a621c8911fe Mon Sep 17 00:00:00 2001 From: oy Date: Fri, 20 Apr 2012 01:13:51 +0200 Subject: fixed that client displays active vote after connecting to a server --- src/game/client/components/voting.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 675d6770..13dbc8a2 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -120,7 +120,12 @@ void CVoting::Vote(int v) CVoting::CVoting() { ClearOptions(); - OnReset(); + + m_Closetime = 0; + m_aDescription[0] = 0; + m_aReason[0] = 0; + m_Yes = m_No = m_Pass = m_Total = 0; + m_Voted = 0; } void CVoting::AddOption(const char *pDescription) @@ -164,6 +169,9 @@ void CVoting::ClearOptions() void CVoting::OnReset() { + if(Client()->State() == IClient::STATE_LOADING) // do not reset active vote while connecting + return; + m_Closetime = 0; m_aDescription[0] = 0; m_aReason[0] = 0; -- cgit 1.4.1