diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-23 16:45:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-23 16:45:51 +0300 |
commit | 6c4c0169b21937853f4892a5c75fafaf024a4314 (patch) | |
tree | 9fb04f968b355c27866dfe1aca6bde36140f666e | |
parent | 11673097858a0469fc138908b735038109e3bf59 (diff) | |
download | plus-6c4c0169b21937853f4892a5c75fafaf024a4314.tar.gz plus-6c4c0169b21937853f4892a5c75fafaf024a4314.tar.bz2 plus-6c4c0169b21937853f4892a5c75fafaf024a4314.tar.xz plus-6c4c0169b21937853f4892a5c75fafaf024a4314.zip |
Add command line option for crash manaplus on start.
-rw-r--r-- | src/client.cpp | 2 | ||||
-rw-r--r-- | src/commandline.cpp | 6 | ||||
-rw-r--r-- | src/options.h | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp index ed7efa69c..4a82ee9ce 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -560,6 +560,8 @@ void Client::gameInit() mButtonPadding = mSkin->getPadding(); mButtonSpacing = mSkin->getOption("spacing", 3); } + if (settings.options.error) + inputManager.executeAction(InputAction::ERROR); } Client::~Client() diff --git a/src/commandline.cpp b/src/commandline.cpp index 562726a1e..506242a2c 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -131,7 +131,7 @@ static void printVersion() void parseOptions(const int argc, char *const argv[]) { - const char *const optstring = "hvud:U:P:Dc:p:y:l:L:C:s:t:T:a:r"; + const char *const optstring = "hvud:U:P:Dc:p:y:l:L:C:s:t:T:a:r:e"; const struct option long_options[] = { @@ -159,6 +159,7 @@ void parseOptions(const int argc, char *const argv[]) { "server-type", required_argument, nullptr, 'y' }, { "enable-ipc", no_argument, nullptr, 'I' }, { "default-cursor", no_argument, nullptr, 'q' }, + { "error", no_argument, nullptr, 'e' }, { nullptr, 0, nullptr, 0 } }; @@ -256,6 +257,9 @@ void parseOptions(const int argc, char *const argv[]) case 'q': options.defaultCursor = true; break; + case 'e': + options.error = true; + break; default: break; } diff --git a/src/options.h b/src/options.h index 82839482b..0411c9efb 100644 --- a/src/options.h +++ b/src/options.h @@ -65,7 +65,8 @@ struct Options final safeMode(false), testMode(false), ipc(false), - defaultCursor(false) + defaultCursor(false), + error(false) {} A_DELETE_COPY(Options) @@ -96,6 +97,7 @@ struct Options final bool testMode; bool ipc; bool defaultCursor; + bool error; }; #endif // OPTIONS_H |