diff --git a/src/creport.c b/src/creport.c index 912011911..fa17c426d 100644 --- a/src/creport.c +++ b/src/creport.c @@ -1568,7 +1568,7 @@ report_computer(const char *filename, report_context * ctx, const char *bom) } fprintf(F, "%d;age\n", f->age); fprintf(F, "%d;Optionen\n", f->options); - if (f->options & want(O_SCORE) && f->age > DISPLAYSCORE) { + if (f->options & WANT_OPTION(O_SCORE) && f->age > DISPLAYSCORE) { char score[32]; write_score(score, sizeof(score), f->score); fprintf(F, "%s;Punkte\n", score); @@ -1615,7 +1615,7 @@ report_computer(const char *filename, report_context * ctx, const char *bom) print_items(F, f->items, f->locale); fputs("OPTIONEN\n", F); for (i = 0; i != MAXOPTIONS; ++i) { - int flag = want(i); + int flag = WANT_OPTION(i); if (options[i]) { fprintf(F, "%d;%s\n", (f->options & flag) ? 1 : 0, options[i]); } diff --git a/src/kernel/faction.c b/src/kernel/faction.c index a31b063b7..90649600f 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -253,8 +253,9 @@ faction *addfaction(const char *email, const char *password, ADDMSG(&f->msgs, msg_message("changepasswd", "value", password)); f->options = - want(O_REPORT) | want(O_ZUGVORLAGE) | want(O_COMPUTER) | want(O_COMPRESS) | - want(O_ADRESSEN) | want(O_STATISTICS); + WANT_OPTION(O_REPORT) | WANT_OPTION(O_ZUGVORLAGE) | + WANT_OPTION(O_COMPUTER) | WANT_OPTION(O_COMPRESS) | + WANT_OPTION(O_ADRESSEN) | WANT_OPTION(O_STATISTICS); f->no = unused_faction_id(); if (rule_region_owners()) { diff --git a/src/kernel/faction.h b/src/kernel/faction.h index e884c71c6..25913e73d 100644 --- a/src/kernel/faction.h +++ b/src/kernel/faction.h @@ -99,7 +99,7 @@ extern "C" { extern struct faction *factions; -#define want(option) (1<store, &n); f->options = n; - n = want(O_REPORT) | want(O_COMPUTER); + n = WANT_OPTION(O_REPORT) | WANT_OPTION(O_COMPUTER); if ((f->options & n) == 0) { /* Kein Report eingestellt, Fehler */ f->options |= n; } if (data->version < JSON_REPORT_VERSION) { /* mistakes were made in the past*/ - f->options &= ~want(O_JSON); + f->options &= ~WANT_OPTION(O_JSON); } read_allies(data, f); read_groups(data, f); @@ -1139,7 +1139,7 @@ void write_faction(gamedata *data, const faction * f) WRITE_INT(data->store, ur->y); } WRITE_SECTION(data->store); - WRITE_INT(data->store, f->options & ~want(O_DEBUG)); + WRITE_INT(data->store, f->options & ~WANT_OPTION(O_DEBUG)); WRITE_SECTION(data->store); for (sf = f->allies; sf; sf = sf->next) { diff --git a/src/report.c b/src/report.c index 25a92ede2..6543b153b 100644 --- a/src/report.c +++ b/src/report.c @@ -2048,7 +2048,7 @@ report_plaintext(const char *filename, report_context * ctx, attrib *a; message *m; unsigned char op; - int maxh, bytes, ix = want(O_STATISTICS); + int maxh, bytes, ix = WANT_OPTION(O_STATISTICS); int wants_stats = (f->options & ix); FILE *F = fopen(filename, "w"); stream strm = { 0 }, *out = &strm; @@ -2098,18 +2098,18 @@ report_plaintext(const char *filename, report_context * ctx, centre(out, buf, true); } } - if ((f->options & want(O_COMPUTER)) == 0) { + if ((f->options & WANT_OPTION(O_COMPUTER)) == 0) { const char *s; s = locale_getstring(f->locale, "newbie_info_cr"); if (s) { newline(out); centre(out, s, true); } - f->options |= want(O_COMPUTER); + f->options |= WANT_OPTION(O_COMPUTER); } } newline(out); - if (f->options & want(O_SCORE) && f->age > DISPLAYSCORE) { + if (f->options & WANT_OPTION(O_SCORE) && f->age > DISPLAYSCORE) { char score[32], avg[32]; write_score(score, sizeof(score), f->score); write_score(avg, sizeof(avg), average_score_of_age(f->age, f->age / 24 + 1)); @@ -2164,7 +2164,7 @@ report_plaintext(const char *filename, report_context * ctx, if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); for (op = 0; op != MAXOPTIONS; op++) { - if (f->options & want(op) && options[op]) { + if (f->options & WANT_OPTION(op) && options[op]) { bytes = (int)str_strlcpy(bufp, " ", size); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); diff --git a/src/reports.c b/src/reports.c index b3aee94e0..602edb83c 100644 --- a/src/reports.c +++ b/src/reports.c @@ -928,7 +928,7 @@ spskill(char *buffer, size_t size, const struct locale * lang, if (!u->number) return 0; if (sv->level <= 0) { - if (sv->old <= 0 || (u->faction->options & want(O_SHOWSKCHANGE)) == 0) { + if (sv->old <= 0 || (u->faction->options & WANT_OPTION(O_SHOWSKCHANGE)) == 0) { return 0; } } @@ -964,7 +964,7 @@ spskill(char *buffer, size_t size, const struct locale * lang, if (wrptr(&bufp, &size, snprintf(bufp, size, "%d", effsk)) != 0) WARN_STATIC_BUFFER(); - if (u->faction->options & want(O_SHOWSKCHANGE)) { + if (u->faction->options & WANT_OPTION(O_SHOWSKCHANGE)) { int oldeff = 0; int diff;