diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-09-14 01:29:30 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-09-14 01:29:30 +0000 |
commit | 21dc5bb7a3ec09dafb41bc84050a2f5fbe0f9311 (patch) | |
tree | 5dfa5d1cebb1ca4ba9637b5ad8957d1c4b35e360 /src/main.cpp | |
parent | 535ac50a68c17e421230875fea05fd1161a92fe6 (diff) | |
download | mana-21dc5bb7a3ec09dafb41bc84050a2f5fbe0f9311.tar.gz mana-21dc5bb7a3ec09dafb41bc84050a2f5fbe0f9311.tar.bz2 mana-21dc5bb7a3ec09dafb41bc84050a2f5fbe0f9311.tar.xz mana-21dc5bb7a3ec09dafb41bc84050a2f5fbe0f9311.zip |
src/gui/char_select.cpp, src/main.cpp: Fix the character name matching loop and add support for saving the last used character (based on a patch by Andrew Harrison).
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 0d4b54d7..08fc7a56 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -468,6 +468,10 @@ void charLogin(Network *network, LoginData *loginData) void mapLogin(Network *network, LoginData *loginData) { + logger->log("Memorizing selected character %s", + player_node->getName().c_str()); + config.setValue("lastCharacter", player_node->getName()); + MessageOut outMsg(network); logger->log("Trying to connect to map server..."); @@ -657,6 +661,9 @@ int main(int argc, char *argv[]) if (((CharSelectDialog*)currentDialog)-> selectByName(options.playername)) options.chooseDefault = true; + else + ((CharSelectDialog*)currentDialog)->selectByName( + config.getValue("lastCharacter", "")); if (options.chooseDefault) ((CharSelectDialog*)currentDialog)->action("ok", NULL); |