Fix a couple of tiny leaks and a couple of minor issues I noticed last night in multiplayer

git-svn-id: https://svn.eduke32.com/eduke32@108 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-04-24 18:52:29 +00:00
parent f2c77fa152
commit fe5671e812
9 changed files with 25 additions and 20 deletions

View file

@ -384,6 +384,7 @@ int Bcorrectfilename(char *filename, int removefn)
if (trailslash) *(first++) = '/'; if (trailslash) *(first++) = '/';
*(first++) = 0; *(first++) = 0;
Bfree(fn);
return 0; return 0;
} }

View file

@ -274,7 +274,7 @@ long initmultiplayersparms(long argc, char **argv)
if ((argv[i][1] == 'p' || argv[i][1] == 'P') && argv[i][2]) { if ((argv[i][1] == 'p' || argv[i][1] == 'P') && argv[i][2]) {
char *p; char *p;
j = strtol(argv[i]+2, &p, 10); j = strtol(argv[i]+2, &p, 10);
if (!(*p) && j > 0 && j<65535) portnum = j; if (!(*p) && j > 1024 && j<65535) portnum = j;
printf("mmulti: Using port %ld\n", portnum); printf("mmulti: Using port %ld\n", portnum);
} }

View file

@ -246,6 +246,9 @@ void OSD_Cleanup(void)
Bfree(symbols); Bfree(symbols);
} }
if (osdlog) Bfclose(osdlog);
osdlog = NULL;
osdinited=0; osdinited=0;
} }

View file

@ -128,7 +128,7 @@ enum gamemodes {
#define MAXANIMWALLS 512 #define MAXANIMWALLS 512
#define MAXINTERPOLATIONS 8192 #define MAXINTERPOLATIONS 8192
#define NUMOFFIRSTTIMEACTIVE 16384 #define MAXQUOTES 16384
#define MAXCYCLERS 1024 #define MAXCYCLERS 1024
@ -435,7 +435,7 @@ extern char buf[1024]; //My own generic input buffer
#define MAXQUOTELEN 64 #define MAXQUOTELEN 64
extern char *fta_quotes[NUMOFFIRSTTIMEACTIVE],*redefined_quotes[NUMOFFIRSTTIMEACTIVE]; extern char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
extern char scantoasc[128],ready2send; extern char scantoasc[128],ready2send;
extern char scantoascwithshift[128]; extern char scantoascwithshift[128];
@ -549,7 +549,6 @@ extern char restorepalette;
extern short buttonstat; extern short buttonstat;
extern long cachecount; extern long cachecount;
extern char boardfilename[BMAX_PATH],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768]; extern char boardfilename[BMAX_PATH],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768];
extern char betaname[80];
extern char cachedebug,earthquaketime; extern char cachedebug,earthquaketime;
extern char networkmode; extern char networkmode;
extern char lumplockbyte[11]; extern char lumplockbyte[11];

View file

@ -1739,6 +1739,8 @@ void coolgaugetext(short snum)
case 7: i = (p->boot_amount>>1); break; case 7: i = (p->boot_amount>>1); break;
} }
invennum(284-30-o,200-6,(char)i,0,10+permbit); invennum(284-30-o,200-6,(char)i,0,10+permbit);
if (j > 0) minitext(288-30-o,180,"ON",0,10+16+permbit + 256);
else if ((unsigned long)j != 0x80000000) minitext(284-30-o,180,"OFF",2,10+16+permbit + 256);
if (p->inven_icon >= 6) minitext(284-35-o,180,"AUTO",2,10+16+permbit + 256); if (p->inven_icon >= 6) minitext(284-35-o,180,"AUTO",2,10+16+permbit + 256);
} }
return; return;
@ -7984,7 +7986,7 @@ void Shutdown( void )
CONTROL_Shutdown(); CONTROL_Shutdown();
CONFIG_WriteSetup(); CONFIG_WriteSetup();
KB_Shutdown(); KB_Shutdown();
for(i=0;i<NUMOFFIRSTTIMEACTIVE;i++) for(i=0;i<MAXQUOTES;i++)
{ {
if(fta_quotes[i] != NULL) if(fta_quotes[i] != NULL)
Bfree(fta_quotes[i]); Bfree(fta_quotes[i]);
@ -7997,7 +7999,13 @@ void Shutdown( void )
Bfree(aGameVars[i].szLabel); Bfree(aGameVars[i].szLabel);
if(aDefaultGameVars[i].szLabel != NULL) if(aDefaultGameVars[i].szLabel != NULL)
Bfree(aDefaultGameVars[i].szLabel); Bfree(aDefaultGameVars[i].szLabel);
if(aGameVars[i].plValues != NULL)
Bfree(aGameVars[i].plValues);
} }
if(label != NULL)
Bfree(label);
if(labelcode != NULL)
Bfree(labelcode);
} }
/* /*

View file

@ -4339,11 +4339,7 @@ repeatcase:
scriptptr--; scriptptr--;
j = 0; j = 0;
while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 )
{ textptr++;
betaname[j] = *textptr;
j++; textptr++;
}
betaname[j] = 0;
return 0; return 0;
case CON_DEFINEVOLUMENAME: case CON_DEFINEVOLUMENAME:
@ -4532,9 +4528,9 @@ repeatcase:
k = *(scriptptr-1); k = *(scriptptr-1);
if(k >= NUMOFFIRSTTIMEACTIVE) if(k >= MAXQUOTES)
{ {
initprintf("%s:%ld: error: quote number exceeds limit of %ld.\n",compilefile,line_number,NUMOFFIRSTTIMEACTIVE); initprintf("%s:%ld: error: quote number exceeds limit of %ld.\n",compilefile,line_number,MAXQUOTES);
error++; error++;
} }

View file

@ -42,7 +42,7 @@ short animatesect[MAXANIMATES];
long msx[2048],msy[2048]; long msx[2048],msy[2048];
short cyclers[MAXCYCLERS][6],numcyclers; short cyclers[MAXCYCLERS][6],numcyclers;
char *fta_quotes[NUMOFFIRSTTIMEACTIVE],*redefined_quotes[NUMOFFIRSTTIMEACTIVE]; char *fta_quotes[MAXQUOTES],*redefined_quotes[MAXQUOTES];
char tempbuf[2048], packbuf[576]; char tempbuf[2048], packbuf[576];
@ -53,8 +53,6 @@ short mirrorwall[64], mirrorsector[64], mirrorcnt;
int current_menu; int current_menu;
char betaname[80];
char level_names[MAXVOLUMES*11][33],level_file_names[MAXVOLUMES*11][BMAX_PATH]; char level_names[MAXVOLUMES*11][33],level_file_names[MAXVOLUMES*11][BMAX_PATH];
long partime[MAXVOLUMES*11],designertime[MAXVOLUMES*11]; long partime[MAXVOLUMES*11],designertime[MAXVOLUMES*11];
char volume_names[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" }; char volume_names[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" };

View file

@ -3829,7 +3829,7 @@ void processinput(short snum)
if( p->dummyplayersprite == -1 ) if( p->dummyplayersprite == -1 )
p->dummyplayersprite = p->dummyplayersprite =
spawn(pi,PLAYERONWATER); spawn(pi,PLAYERONWATER);
sprite[p->dummyplayersprite].pal = sprite[p->i].pal;
p->footprintcount = 6; p->footprintcount = 6;
if(sector[p->cursectnum].floorpicnum == FLOORSLIME) if(sector[p->cursectnum].floorpicnum == FLOORSLIME)
p->footprintpal = 8; p->footprintpal = 8;

View file

@ -290,7 +290,7 @@ int loadplayer(signed char spot)
if (kdfread(&i,sizeof(long),1,fil) != 1) goto corrupt; if (kdfread(&i,sizeof(long),1,fil) != 1) goto corrupt;
while(i != NUMOFFIRSTTIMEACTIVE) while(i != MAXQUOTES)
{ {
if(fta_quotes[i] != NULL) if(fta_quotes[i] != NULL)
Bfree(fta_quotes[i]); Bfree(fta_quotes[i]);
@ -660,7 +660,7 @@ int saveplayer(signed char spot)
dfwrite(&spritecache[0],sizeof(spritecache[0]),MAXTILES,fil); dfwrite(&spritecache[0],sizeof(spritecache[0]),MAXTILES,fil);
for(i=0;i<NUMOFFIRSTTIMEACTIVE;i++) for(i=0;i<MAXQUOTES;i++)
{ {
if(fta_quotes[i] != NULL) if(fta_quotes[i] != NULL)
{ {