diff --git a/src/main.c b/src/main.c index 7174eb5..e44375c 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.18 2003/12/24 02:38:15 stpohle Exp $ */ +/* $Id: main.c,v 1.19 2004/01/04 00:24:21 stpohle Exp $ */ #include "basic.h" #include "bomberclone.h" @@ -56,7 +56,7 @@ main (int argc, char **argv) break; } } - + gfx_shutdown (); return 0; diff --git a/src/netmenu.c b/src/netmenu.c index 784fc21..8dc9450 100644 --- a/src/netmenu.c +++ b/src/netmenu.c @@ -194,7 +194,9 @@ void multiplayer_game () { void join_multiplayer_game () { - int i; + int i, old_ai_family; + + old_ai_family = bman.net_ai_family; multiplayer_firstrun (); if (network_init () < 0) { @@ -202,8 +204,17 @@ join_multiplayer_game () return; } - /* do the serverlist menu and join a server */ - net_getserver (); + net_getserver (); /* show Serverlist */ + + /* if the AI Family Changed, restart the whole network */ + if (old_ai_family != bman.net_ai_family) { + network_shutdown (); + if (network_init () < 0) { + d_printf ("network_init () FAILED\n"); + return; + } + } + if (bman.servername[0] != 0) { /* join the server, convert to a usable sockaddr first */ network_server_port (bman.servername, players[0].net.addr.host, @@ -230,7 +241,7 @@ join_multiplayer_game () /* go into the normal multiplayer loop */ multiplayer_game (); } - + network_shutdown (); };