diff options
author | tycho <work.tycho@gmail.com> | 2015-05-18 16:43:26 +0200 |
---|---|---|
committer | tycho <work.tycho@gmail.com> | 2015-05-18 16:43:26 +0200 |
commit | c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13 (patch) | |
tree | 114df164ac68efe378901fd75f73954d0b9a593d | |
parent | Added deoxy comments (diff) | |
download | cuberite-c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13.tar cuberite-c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13.tar.gz cuberite-c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13.tar.bz2 cuberite-c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13.tar.lz cuberite-c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13.tar.xz cuberite-c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13.tar.zst cuberite-c2303ac4cf072f8e273ba9ddf72f5ef88c4baf13.zip |
Diffstat (limited to '')
-rw-r--r-- | src/main.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index a0f51105a..2cf4b383e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -373,12 +373,17 @@ std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv) TCLAP::ValueArg<int> slotsArg("s", "max-players", "Maximum number of slots for the server to use, overrides setting in setting.ini", false, -1, "number", cmd); cmd.parse(argc, argv); - - int slots = slotsArg.getValue(); auto repo = cpp14::make_unique<cMemorySettingsRepository>(); - repo->SetValueI("Server", "MaxPlayers", slots); + if (slotsArg.isSet()) + { + + int slots = slotsArg.getValue(); + + repo->SetValueI("Server", "MaxPlayers", slots); + + } repo->SetReadOnly(); @@ -387,7 +392,7 @@ std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv) catch (TCLAP::ArgException &e) { printf("error reading command line %s for arg %s", e.error().c_str(), e.argId().c_str()); - return nullptr; + return cpp14::make_unique<cMemorySettingsRepository>(); } } |