When verifying objects, do not necessarily check for controlcen as it's not necessarily there in some anarchy missions

This commit is contained in:
zicodxx 2010-11-23 16:16:22 +01:00
parent 83d746151a
commit 5a6fb73ed2
3 changed files with 7 additions and 22 deletions

View file

@ -3,6 +3,7 @@ D1X-Rebirth Changelog
20101123
--------
main/net_udp.h: reducing max buffer size of an UDP packet from 1024 to 576 bytes - should prevent possible turncating, especially when sending obejcts where max size is actually used
main/net_ipx.c, main/net_udp.c: When verifying objects, do not necessarily check for controlcen as it's not necessarily there in some anarchy missions
20101122
--------

View file

@ -2074,26 +2074,18 @@ net_ipx_pack_objects(void)
int
net_ipx_verify_objects(int remote, int local)
{
int i;
int nplayers, got_controlcen=0;
int i, nplayers = 0;
if ((remote-local) > 10)
return(-1);
if (Game_mode & GM_MULTI_ROBOTS)
got_controlcen = 1;
nplayers = 0;
return(2);
for (i = 0; i <= Highest_object_index; i++)
{
if ((Objects[i].type == OBJ_PLAYER) || (Objects[i].type == OBJ_GHOST))
nplayers++;
if (Objects[i].type == OBJ_CNTRLCEN)
got_controlcen=1;
}
if (got_controlcen && (nplayers >= MaxNumNetPlayers))
if (MaxNumNetPlayers<=nplayers)
return(0);
return(1);

View file

@ -2423,26 +2423,18 @@ net_udp_pack_objects(void)
int
net_udp_verify_objects(int remote, int local)
{
int i;
int nplayers, got_controlcen=0;
int i, nplayers = 0;
if ((remote-local) > 10)
return(-1);
if (Game_mode & GM_MULTI_ROBOTS)
got_controlcen = 1;
nplayers = 0;
return(2);
for (i = 0; i <= Highest_object_index; i++)
{
if ((Objects[i].type == OBJ_PLAYER) || (Objects[i].type == OBJ_GHOST))
nplayers++;
if (Objects[i].type == OBJ_CNTRLCEN)
got_controlcen=1;
}
if (got_controlcen && (MaxNumNetPlayers<=nplayers))
if (MaxNumNetPlayers<=nplayers)
return(0);
return(1);