static char *ServerOptions_SetMapList( void ) {
	static vmCvar_t maplistvar[1024];
       vmCvar_t curlist;
	static char mapcmd[64];
       char maplist[1024];
       char temp[64];
       char temp2[64];
       char *pos;
       char *pos2;
       int i,j;

	mapcmd[0] = '\0';
	//Set up the vars from the map list stuff
	//set d1 "map q3jbcath ; set nextmap vstr d2"

       Q_strncpyz(maplist,s_serveroptions.maplist.field.buffer,1024);
	//Use a kind of chasing pointers so we know when we're at the end before we get there
	pos = (char *)strtok(maplist,";\n\r");
	if (pos)
		pos2 = (char *)strtok(NULL,";\n\r");
	else
		pos2 = NULL;
	i = 1;
       temp2[0] = '\0';
       Q_strcat(temp2,64,"map ");
       Q_strcat(temp2,64, s_startserver.maplist[s_startserver.currentmap]);
       Q_strcat(temp2,64,"; set nextmap vstr maplist1");
       trap_Cvar_Register(&curlist, "begincycle","", CVAR_ARCHIVE);
       trap_Cvar_Set(va("begincycle",i),temp2);
	while (pos != NULL) {
		temp[0] = '\0';
		Q_strcat(temp,64,"map ");
		Q_strcat(temp,64,pos);
		if (pos2)
			Q_strcat(temp,64,va("; set nextmap vstr maplist%d",i+1));
		else
              {
                     Q_strcat(temp,64,"; set nextmap vstr begincycle"); // vstr begincycle
                     for (j = i+1; j < 32; j++)
                            trap_Cvar_Set(va("maplist%d",j), "");
              }
		trap_Cvar_Register(&maplistvar[1],va("maplist%d",i),"", CVAR_ARCHIVE);
		trap_Cvar_Set(va("maplist%d",i),temp);
		if (!Q_stricmp(pos, s_startserver.maplist[s_startserver.currentmap]))
			Q_strncpyz(mapcmd,va("maplist%d",i),64);
		pos = pos2;
		if (pos)
			pos2 = (char *)strtok(NULL,";\n\r");
		i++;
	}
	return mapcmd;
}

static void GetWeaponOrder( void ) {
	char temp[64], *pos, *pos2;
	int i;
//       for (i = 1; i < 128; i++) {
		Q_strncpyz(temp,UI_Cvar_VariableString(va("maplist%d",i)), 64);
		if (temp[0] == '\0') break;
              pos = (char *)strtok(temp,"/");
		if (!pos) continue;
              pos2 = strstr(temp,"map");
		if (!pos2) continue;
		pos2 += 4;
		if (s_serveroptions.maplist.field.buffer[0] != '\0')
                     Q_strcat(s_serveroptions.maplist.field.buffer,256,";");
              Q_strcat(s_serveroptions.maplist.field.buffer,256, pos2);
//       }
}

