From ad3623ced5020c9c886cb85100ae05efa460f84a Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 30 Apr 2005 13:29:45 +0000 Subject: Some fixes to player control, also attempting to solve long walk path problem. --- src/gui/chat.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui/chat.cpp') diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 49841623..380d9d13 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -213,13 +213,21 @@ void ChatWindow::action(const std::string& eventId) std::string message = chatInput->getText(); if (message.length() > 0) { + // If message different from previous, put it in the history if (history.size() == 0 || message != history.back()) { history.push_back(message); } + + // Reset history iterator curHist = history.end(); + + // Send the message to the server chat_send(char_info[0].name, message.c_str()); + + // Clear the text from the chat input chatInput->setText(""); } + gui->focusNone(); } } -- cgit v1.2.3-70-g09d2