From d6338db94d8402c3f47a422069d352fced1e496e Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 29 Sep 2018 11:07:53 +0200 Subject: [PATCH] improved handling network errors (show message instead of stopping program) --- src/network.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/network.c b/src/network.c index eb2c5bd0..1b9a1386 100644 --- a/src/network.c +++ b/src/network.c @@ -284,7 +284,16 @@ boolean ConnectToServer(char *hostname, int port) SDLNet_ResolveHost(&ip, hostname, port); if (ip.host == INADDR_NONE) - Error(ERR_EXIT, "cannot locate host '%s'", hostname); + { + char message[100]; + + sprintf(message, "Failed to resolve network server hostname '%s'!", + hostname); + + DrawNetworkText_Failed(message); + + return FALSE; + } else server_host = SDLNet_Read32(&ip.host); -- 2.34.1