From bc510d9de037b665dc96f97da1848d69e5a8b0ed Mon Sep 17 00:00:00 2001 From: Bertram Date: Thu, 21 Jan 2010 00:04:59 +0100 Subject: Corrected the --default option behaviour to follow --help definition. The --help options tells: -D --default : Choose default character server and character The client now choose the defaulted last character entry when --default is set. The --character option still has precedence. Also added a return value to the CharSelectDialog->chooseSelected() function while on it, in case of someone willing to add errors handling at this stage. --- src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 69b45091..af1057a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1073,8 +1073,12 @@ int main(int argc, char *argv[]) } else { - ((CharSelectDialog*) currentDialog)->selectByName( - config.getValue("lastCharacter", "")); + if (((CharSelectDialog*) currentDialog)->selectByName( + config.getValue("lastCharacter", ""))) + { + if (options.chooseDefault) + ((CharSelectDialog*) currentDialog)->chooseSelected(); + } } break; -- cgit v1.2.3-70-g09d2