forked from github/server
smaller fixes
This commit is contained in:
parent
65786fc059
commit
bee21c7597
3 changed files with 18 additions and 16 deletions
|
@ -1109,7 +1109,7 @@ restart(unit * u, struct order * ord)
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
EnhancedQuit()
|
EnhancedQuit(void)
|
||||||
{
|
{
|
||||||
static int value = -1;
|
static int value = -1;
|
||||||
if (value<0) {
|
if (value<0) {
|
||||||
|
|
|
@ -146,15 +146,16 @@ AllianceAuto(void)
|
||||||
{
|
{
|
||||||
static int value = -1;
|
static int value = -1;
|
||||||
if (value<0) {
|
if (value<0) {
|
||||||
char * str = strdup(get_param(global.parameters, "alliance.auto"));
|
const char * str = get_param(global.parameters, "alliance.auto");
|
||||||
value = 0;
|
value = 0;
|
||||||
if (str!=NULL) {
|
if (str!=NULL) {
|
||||||
char * tok = strtok(str, " ");
|
char * sstr = strdup(str);
|
||||||
|
char * tok = strtok(sstr, " ");
|
||||||
while (tok) {
|
while (tok) {
|
||||||
value |= ally_flag(tok);
|
value |= ally_flag(tok);
|
||||||
tok = strtok(NULL, " ");
|
tok = strtok(NULL, " ");
|
||||||
}
|
}
|
||||||
free(str);
|
free(sstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
@ -165,15 +166,16 @@ AllianceRestricted(void)
|
||||||
{
|
{
|
||||||
static int value = -1;
|
static int value = -1;
|
||||||
if (value<0) {
|
if (value<0) {
|
||||||
char * str = strdup(get_param(global.parameters, "alliance.restricted"));
|
const char * str = get_param(global.parameters, "alliance.restricted");
|
||||||
value = 0;
|
value = 0;
|
||||||
if (str!=NULL) {
|
if (str!=NULL) {
|
||||||
char * tok = strtok(str, " ");
|
char * sstr = strdup(str);
|
||||||
|
char * tok = strtok(sstr, " ");
|
||||||
while (tok) {
|
while (tok) {
|
||||||
value |= ally_flag(tok);
|
value |= ally_flag(tok);
|
||||||
tok = strtok(NULL, " ");
|
tok = strtok(NULL, " ");
|
||||||
}
|
}
|
||||||
free(str);
|
free(sstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -228,16 +228,16 @@ seed_dropouts(void)
|
||||||
void
|
void
|
||||||
read_newfactions(const char * filename)
|
read_newfactions(const char * filename)
|
||||||
{
|
{
|
||||||
FILE * F = fopen(filename, "r");
|
FILE * F = fopen(filename, "r");
|
||||||
if (F==NULL) return;
|
if (F==NULL) return;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
faction * f = factions;
|
faction * f = factions;
|
||||||
char race[20], email[64], lang[8], password[16];
|
char race[20], email[64], lang[8], password[16];
|
||||||
newfaction *nf;
|
newfaction *nf;
|
||||||
int bonus, subscription;
|
int bonus, subscription;
|
||||||
|
int alliance;
|
||||||
|
|
||||||
if (alliances!=NULL) {
|
if (alliances!=NULL) {
|
||||||
int alliance;
|
|
||||||
/* email;race;locale;startbonus;subscription;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;
|
if (fscanf(F, "%s %s %s %d %d %s %d", email, race, lang, &bonus, &subscription, password, &alliance)<=0) break;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue