moved slist loading into cl_slist.c

This commit is contained in:
Chris Ison 2001-03-08 23:53:03 +00:00
parent 930da9109c
commit 69fd58944e
3 changed files with 21 additions and 14 deletions

View file

@ -63,4 +63,5 @@ char *gettokstart(char *str, int req, char delim);
int gettoklen(char *str, int req, char delim);
void timepassed (double time1, double *time2);
void SList_Init (void);
#endif // _CL_SLIST_H

View file

@ -1111,9 +1111,7 @@ CL_Download_f (void)
void
CL_Init (void)
{
QFile *servlist;
char st[80];
char e_path[MAX_OSPATH];
cls.state = ca_disconnected;
@ -1135,18 +1133,8 @@ CL_Init (void)
CL_TEnts_Init ();
Pmove_Init ();
Qexpand_squiggle (fs_userpath->string, e_path);
if ((servlist = Qopen (va ("%s/servers.txt", e_path), "r"))) {
slist = SL_LoadF (servlist, slist);
Qclose (servlist);
} else {
Qexpand_squiggle (fs_sharepath->string, e_path);
if ((servlist = Qopen (va ("%s/servers.txt", e_path), "r"))) {
slist = SL_LoadF (servlist, slist);
Qclose (servlist);
}
}
SList_Init ();
//
// register our commands
//

View file

@ -316,3 +316,21 @@ void timepassed (double time1, double *time2)
{
*time2 -= time1;
}
void SList_Init (void)
{
QFile *servlist;
char e_path[MAX_OSPATH];
Qexpand_squiggle (fs_userpath->string, e_path);
if ((servlist = Qopen (va ("%s/servers.txt", e_path), "r"))) {
slist = SL_LoadF (servlist, slist);
Qclose (servlist);
} else {
Qexpand_squiggle (fs_sharepath->string, e_path);
if ((servlist = Qopen (va ("%s/servers.txt", e_path), "r"))) {
slist = SL_LoadF (servlist, slist);
Qclose (servlist);
}
}
}