fixed bug found by Lars Poeschel, contest.to = -1 hasend been checked right in do_contest

origin
stpohle 18 years ago
parent 396fe092cd
commit 9e3e86249d

@ -245,11 +245,15 @@ do_contest (struct pkg_contest *ct_pkg, _net_addr * addr)
/* master will have to change the firewall flag on a player */ /* master will have to change the firewall flag on a player */
if (GT_MP_PTPM) { if (GT_MP_PTPM) {
if (ct_pkg->from < 0 || ct_pkg->from >= MAX_PLAYERS) { if ((ct_pkg->from < 0 || ct_pkg->from >= MAX_PLAYERS
if ((ct_pkg->to < 0 || ct_pkg->to >= MAX_PLAYERS) && addr->pl_nr != ct_pkg->from) || ct_pkg->to < -1 || ct_pkg->to >= MAX_PLAYERS
d_printf (" from or to value out of range (0-MAX_PLAYERS)\n"); || addr->pl_nr != ct_pkg->from) {
return; d_printf (" from or to value out of range (0-MAX_PLAYERS)\n");
} return;
}
/* ignore packet it's just a workaround for
* some hardware router */
if ((ct_pkg->to == -1) return;
players[ct_pkg->to].net.flags &= (0xFF - NETF_firewall); players[ct_pkg->to].net.flags &= (0xFF - NETF_firewall);
net_game_send_player (ct_pkg->to); net_game_send_player (ct_pkg->to);
@ -371,6 +375,8 @@ do_playerid (struct pkg_playerid *p_id, _net_addr * addr)
else else
pl->state = p_id->state & (0xFF - PSF_alife); pl->state = p_id->state & (0xFF - PSF_alife);
/* set the NETWORK flag for the network player.
* this had to be done after the contest part. */
if (p_id->pl_nr != bman.p_nr && PS_IS_used (pl->state)) if (p_id->pl_nr != bman.p_nr && PS_IS_used (pl->state))
pl->state |= PSF_net; pl->state |= PSF_net;
else else

Loading…
Cancel
Save