when updating game info also check for player connected status in case we send to everyone

This commit is contained in:
zicodxx 2012-05-16 10:41:12 +02:00
parent 383a00cd9c
commit a7420efb13
2 changed files with 9 additions and 0 deletions

View file

@ -3,6 +3,7 @@ D1X-Rebirth Changelog
20120516
--------
main/game.c: In Multiplayer when taking damage, the game will only leave menus when shield drop below 5
main/net_udp.c: when updating game info also check for player connected status in case we send to everyone
20120515
--------

View file

@ -2228,6 +2228,8 @@ void net_udp_send_netgame_update()
for (i=1; i<N_players; i++ )
{
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
net_udp_send_game_info(GBcast, UPID_GAME_INFO_LITE);
@ -3351,6 +3353,8 @@ int net_udp_send_sync(void)
Netgame.numplayers = 0;
for (i=1; i<N_players; i++)
{
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_dump_player(Netgame.players[i].protocol.udp.addr, DUMP_ABORTED);
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
@ -3542,6 +3546,8 @@ abort:
// Tell everyone we're bailing
Netgame.numplayers = 0;
for (i=1; i<save_nplayers; i++) {
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_dump_player(Netgame.players[i].protocol.udp.addr, DUMP_ABORTED);
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
@ -3873,6 +3879,8 @@ void net_udp_leave_game()
N_players=0;
for (i=1; i<nsave; i++ )
{
if (Players[i].connected == CONNECT_DISCONNECTED)
continue;
net_udp_send_game_info(Netgame.players[i].protocol.udp.addr, UPID_GAME_INFO);
}
net_udp_send_game_info(GBcast, UPID_GAME_INFO_LITE);