diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index c90e6fde3..8186e26c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1671,10 +1671,9 @@ int main(int argc, char *argv[]) //infostream<<"Main: password hash: '"<<password<<"'"<<std::endl; address = menudata.address; - try { - port = stoi(menudata.port); - } - catch (NumericException&e) {} + int newport = stoi(menudata.port); + if(newport != 0) + port = newport; simple_singleplayer_mode = menudata.simple_singleplayer_mode; |