This fixes a defect which could cause the game to crash when a duke3d_w32 network configuration file without explicitly defined ports is used.

git-svn-id: https://svn.eduke32.com/eduke32@486 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2007-02-11 22:05:50 +00:00
parent e96c05767e
commit 465b5041f3
1 changed files with 13 additions and 6 deletions

View File

@ -3217,14 +3217,14 @@ void displayrest(long smoothratio)
dotint = 1; dotint = 1;
} }
// reset a normal palette // reset a normal palette
/* else */ if (restorepalette) else if (restorepalette)
{ {
//setbrightness(ud.brightness>>2,&pp->palette[0],0); //setbrightness(ud.brightness>>2,&pp->palette[0],0);
setgamepalette(pp,pp->palette,2); setgamepalette(pp,pp->palette,2);
restorepalette = 0; restorepalette = 0;
} }
// loogies courtesy of being snotted on // loogies courtesy of being snotted on
/* else */ if (pp->loogcnt > 0) else if (pp->loogcnt > 0)
{ {
//palto(0,64,0,(pp->loogcnt>>1)+128); //palto(0,64,0,(pp->loogcnt>>1)+128);
fader = 0; fader = 0;
@ -8183,10 +8183,17 @@ static int load_rancid_net(char *fn)
if (scriptfile_getstring(script,&ip)) break; if (scriptfile_getstring(script,&ip)) break;
Bstrcpy(rancid_ip_strings[MAXPLAYERS-1],ip); Bstrcpy(rancid_ip_strings[MAXPLAYERS-1],ip);
Bstrcpy(rancid_ip_strings[rancid_players++],ip); Bstrcpy(rancid_ip_strings[rancid_players++],ip);
strtok(ip,":"); if (strtok(ip,":"))
Bsprintf(tempbuf,"%s",strtok(NULL,":")); {
if (atoi(tempbuf) > 1024) char *p = strtok(NULL,":");
Bsprintf(rancid_local_port_string,"-p %s",tempbuf);
if (p != NULL)
{
Bsprintf(tempbuf,"%s",p);
if (atoi(tempbuf) > 1024)
Bsprintf(rancid_local_port_string,"-p %s",tempbuf);
}
}
} }
break; break;
case T_MODE: case T_MODE: