From 4486b04a4d781a63a71d7a66a15cd4f2a4563efc Mon Sep 17 00:00:00 2001 From: stpohle Date: Tue, 30 Nov 2004 23:42:24 +0000 Subject: [PATCH] do_quit from a server will make sure that the new server will have control of the ai players, PSF_net will be deleted by all AI players. --- src/packets.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/packets.c b/src/packets.c index 5de105f..f7e0648 100644 --- a/src/packets.c +++ b/src/packets.c @@ -1033,8 +1033,16 @@ do_quit (struct pkg_quit *q_dat, _net_addr * addr) d_printf ("do_quit: new server is set to: %d\n", q_dat->new_server); bman.p_servnr = q_dat->new_server; - if (GT_MP_PTPM && bman.notifygamemaster) + if (GT_MP_PTPM && bman.notifygamemaster) { + /* if there are any AI players delete the network flag from them */ + int i; + + for (i = 0; i < MAX_PLAYERS; i++) + if (PS_IS_aiplayer (players[i].state)) + players[i].state &= (0xFF - PSF_net); + send_ogc_update (); + } } bman.updatestatusbar=1;