shithub: choc

Download patch

ref: 1b95bf7679de60d2d7888c8b13af9743b39a5f73
parent: 24a33a805b51af0dec3be1bdcffa3dc9c3f524e2
author: Simon Howard <[email protected]>
date: Wed Apr 9 19:55:12 EDT 2014

setup: Show error when server address not entered.

Don't launch the game if a server address has not been entered; show a
message to the user instead. This fixes #121.

--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -795,6 +795,13 @@
 {
     execute_context_t *exec;
 
+    if (connect_address == NULL || strlen(connect_address) <= 0)
+    {
+        TXT_MessageBox(NULL, "Please enter a server address\n"
+                             "to connect to.");
+        return;
+    }
+
     exec = NewExecuteContext();
 
     AddCmdLineParameter(exec, "-connect %s", connect_address);