summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-12-05 16:15:00 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-12-05 16:15:00 +0000
commit5e695dfaa659614d76e4215619625aa74134400f (patch)
treeaa2a0c9ff7ed522452f0cbb2256aabd1d8a0c7ef
parentfd9af90faa9348f42666ebb04ccea2d5911e7d54 (diff)
downloadmana-client-5e695dfaa659614d76e4215619625aa74134400f.tar.gz
mana-client-5e695dfaa659614d76e4215619625aa74134400f.tar.bz2
mana-client-5e695dfaa659614d76e4215619625aa74134400f.tar.xz
mana-client-5e695dfaa659614d76e4215619625aa74134400f.zip
Avoid crashing on trying to log the name of a non-existing character.
-rw-r--r--ChangeLog8
-rw-r--r--src/gui/char_server.cpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b5cc04e3..1637c727 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,11 @@
+2005-12-05 Bjørn Lindeijer <bjorn@lindeijer.nl>
+
+ * src/gui/char_server.cpp: Avoid crashing on trying to log the name
+ of a non-existing character.
+
2005-11-13 Eugenio Favalli <elvenprogrammer@gmail.com>
- * The Mana World.dev, src/gui/char_server.cpp: Updated Dev-Cpp project
- file, removed a crashing log.
+ * The Mana World.dev: Updated Dev-Cpp project file.
2005-11-13 Bjørn Lindeijer <bjorn@lindeijer.nl>
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 7a9090cd..202c3e29 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -224,8 +224,12 @@ void ServerSelectDialog::selectServer(int index)
state = CHAR_SELECT_STATE;
- logger->log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
- char_info[0]->name.c_str(), msg.getId(), msg.getLength());
+ if (n_character > 0)
+ {
+ logger->log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
+ char_info[0]->name.c_str(), msg.getId(),
+ msg.getLength());
+ }
skip(msg.getLength());
}