Menu will now ignore an invalid port or the port 0.
authorPerttu Ahola <celeron55@gmail.com>
Fri, 15 Apr 2011 20:35:32 +0000 (23:35 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Fri, 15 Apr 2011 20:35:32 +0000 (23:35 +0300)
src/main.cpp

index 117670366c0c50feb82640ae7e94e930df65b033..bf5f3182b36c0e0a45c8dce234cd83dccfb9daaa 100644 (file)
@@ -121,6 +121,11 @@ Game content:
   are possible.\r
 - Keys to chests?\r
 \r
+- The Treasure Guard; a big monster with a hammer\r
+       - The hammer does great damage, shakes the ground and removes a block\r
+       - You can drop on top of it, and have some time to attack there\r
+         before he shakes you off\r
+\r
 Documentation:\r
 --------------\r
 \r
@@ -1990,7 +1995,10 @@ int main(int argc, char *argv[])
 \r
                playername = wide_to_narrow(menudata.name);\r
                address = wide_to_narrow(menudata.address);\r
-               port = stoi(wide_to_narrow(menudata.port));\r
+               int newport = stoi(wide_to_narrow(menudata.port));\r
+               if(newport != 0)\r
+                       port = newport;\r
+               //port = stoi(wide_to_narrow(menudata.port));\r
                g_settings.set("creative_mode", itos(menudata.creative_mode));\r
                \r
                // Check for valid parameters, restart menu if invalid.\r