From 2a8a230c7768b945f8c53fda15f3e8b184e7da80 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Sat, 24 Jan 2009 19:37:31 -0700 Subject: Changed GM status updating to check whether asserting is allowed or not, as well as adding in a missing delete. Signed-off-by: Ira Rice --- src/gui/chat.cpp | 16 ++++++---------- src/gui/gui.cpp | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 031b6811..d1069d13 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -137,7 +137,7 @@ void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord) else { // Fix the owner of welcome message. - if (line.substr(0, 7) == _("Welcome")) + if (line.substr(0, 7) == "Welcome") { own = BY_SERVER; } @@ -192,6 +192,11 @@ void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord) break; } + if (tmp.nick == ": " && tmp.text.substr(0, 17) == "Visible GM status") + { + player_node->setGM(); + } + // Get the current system time time_t t; time(&t); @@ -391,15 +396,6 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) // Prepare ordinary message if (msg.substr(0, 1) != "/") { - // The server never tells you about your own GM status, so work around - // this for now by intercepting it here. NOTE: This assumes that the - // assert works, when it's not guaranteed to. - - std::size_t space = msg.find(" "); - const std::string command = msg.substr(1, space); - if (msg.at(0) == '@' && command == "assert") - player_node->setGM(); - msg = nick + " : " + msg; MessageOut outMsg(mNetwork); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index fe8cae78..dda171e0 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -170,6 +170,7 @@ Gui::~Gui() mMouseCursors->decRef(); delete mGuiFont; + delete boldFont; delete viewport; delete getTop(); -- cgit v1.2.3-70-g09d2