smaller fixes

This commit is contained in:
Enno Rehling 2004-06-27 18:56:03 +00:00
parent 65786fc059
commit bee21c7597
3 changed files with 18 additions and 16 deletions

View file

@ -1109,7 +1109,7 @@ restart(unit * u, struct order * ord)
}
static boolean
EnhancedQuit()
EnhancedQuit(void)
{
static int value = -1;
if (value<0) {

View file

@ -146,15 +146,16 @@ AllianceAuto(void)
{
static int value = -1;
if (value<0) {
char * str = strdup(get_param(global.parameters, "alliance.auto"));
const char * str = get_param(global.parameters, "alliance.auto");
value = 0;
if (str!=NULL) {
char * tok = strtok(str, " ");
char * sstr = strdup(str);
char * tok = strtok(sstr, " ");
while (tok) {
value |= ally_flag(tok);
tok = strtok(NULL, " ");
}
free(str);
free(sstr);
}
}
return value;
@ -165,15 +166,16 @@ AllianceRestricted(void)
{
static int value = -1;
if (value<0) {
char * str = strdup(get_param(global.parameters, "alliance.restricted"));
const char * str = get_param(global.parameters, "alliance.restricted");
value = 0;
if (str!=NULL) {
char * tok = strtok(str, " ");
char * sstr = strdup(str);
char * tok = strtok(sstr, " ");
while (tok) {
value |= ally_flag(tok);
tok = strtok(NULL, " ");
}
free(str);
free(sstr);
}
}
return value;

View file

@ -228,16 +228,16 @@ seed_dropouts(void)
void
read_newfactions(const char * filename)
{
FILE * F = fopen(filename, "r");
if (F==NULL) return;
for (;;) {
faction * f = factions;
char race[20], email[64], lang[8], password[16];
newfaction *nf;
int bonus, subscription;
FILE * F = fopen(filename, "r");
if (F==NULL) return;
for (;;) {
faction * f = factions;
char race[20], email[64], lang[8], password[16];
newfaction *nf;
int bonus, subscription;
int alliance;
if (alliances!=NULL) {
int alliance;
/* email;race;locale;startbonus;subscription;alliance */
if (fscanf(F, "%s %s %s %d %d %s %d", email, race, lang, &bonus, &subscription, password, &alliance)<=0) break;
} else {