From bcda2a67a05cce862defde8661de3d6ae3abc2fb Mon Sep 17 00:00:00 2001 From: stpohle Date: Sun, 20 Feb 2005 21:34:03 +0000 Subject: [PATCH] playerid is send too many times also gfx change was still possible to do in a diffrent gamestate as GS_wait. --- src/packets.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/packets.c b/src/packets.c index 751ba14..5b37d08 100644 --- a/src/packets.c +++ b/src/packets.c @@ -341,7 +341,9 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr) /* Check if we have to make a network test.. only client to client * we won't check 2 players too because i't won't be possible to send - * something to them. Start the timer for the connection test. */ + * something to them. + * + * Check only as long as pl->state is still not a network player */ if (GT_MP_PTPS && !(PS_IS_netplayer (pl->state)) && (PS_IS_netplayer (p_id->state)) && p_id->pl_nr != bman.p_servnr && p_id->pl_nr != bman.p_nr && !(pl->net.flags & NETF_local2) && p_id->pl_nr != bman.p2_nr) { @@ -375,7 +377,16 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr) net_send_playerid (addr->pl_nr); } - // d_playerdetail ("*** PLAYER List ***"); + /* + * if we are already in a game don't let the player change the gfx */ + else if (GT_MP_PTPM && p_id->pl_nr >= 0 && p_id->pl_nr < MAX_PLAYERS && + p_id->pl_nr != bman.p_nr && p_id->pl_nr != bman.p2_nr && bman.state != GS_wait) { + /* Send all connected players the new PlayerID */ + if (GT_MP_PTPM && GS_WAITRUNNING && addr->pl_nr >= 0 && addr->pl_nr < MAX_PLAYERS) + net_send_playerid (addr->pl_nr); + } + + // d_playerdetail ("*** PLAYER List ***"); team_update (); bman.updatestatusbar = 1; };