From 303eb863998402c308c46dcfa4bc8bc1e9433885 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 17 Nov 2016 21:29:15 +0100 Subject: [PATCH] factionid and curseid are also boring. --- src/kernel/config.h | 2 -- src/kernel/faction.c | 6 +++--- src/kernel/save.c | 2 +- src/laws.c | 2 +- src/modules/score.c | 2 +- src/report.c | 2 +- src/reports.c | 8 ++++---- src/summary.c | 4 ++-- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/kernel/config.h b/src/kernel/config.h index 2f36f6bc9..a15a77ba4 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -47,8 +47,6 @@ struct param; #define buildingid(x) itoa36((x)->no) #define shipid(x) itoa36((x)->no) -#define factionid(x) itoa36((x)->no) -#define curseid(x) itoa36((x)->no) const char * game_name(void); int game_id(void); diff --git a/src/kernel/faction.c b/src/kernel/faction.c index 0172ea835..6d2430de4 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -273,11 +273,11 @@ faction *addfaction(const char *email, const char *password, addlist(&factions, f); fhash(f); - slprintf(buf, sizeof(buf), "%s %s", LOC(loc, "factiondefault"), factionid(f)); + slprintf(buf, sizeof(buf), "%s %s", LOC(loc, "factiondefault"), itoa36(f->no)); f->name = _strdup(buf); if (!f->race) { - log_warning("creating a faction that has no race", factionid(f)); + log_warning("creating a faction that has no race", itoa36(f->no)); } return f; @@ -828,7 +828,7 @@ int writepasswd(void) for (f = factions; f; f = f->next) { fprintf(F, "%s:%s:%s:%u\n", - factionid(f), f->email, f->_password, f->subscription); + itoa36(f->no), f->email, f->_password, f->subscription); } fclose(F); return 0; diff --git a/src/kernel/save.c b/src/kernel/save.c index fa2beabc6..83fa72f76 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1291,7 +1291,7 @@ faction *read_faction(struct gamedata * data) }; f->banner = _strdup(name); - log_debug(" - Lese Partei %s (%s)", f->name, factionid(f)); + log_debug(" - Lese Partei %s (%s)", f->name, itoa36(f->no)); READ_STR(data->store, name, sizeof(name)); if (set_email(&f->email, name) != 0) { diff --git a/src/laws.c b/src/laws.c index 0ba3f4077..fd4f50b78 100644 --- a/src/laws.c +++ b/src/laws.c @@ -997,7 +997,7 @@ int quit_cmd(unit * u, struct order *ord) char buffer[64]; write_order(ord, buffer, sizeof(buffer)); cmistake(u, ord, 86, MSG_EVENT); - log_warning("QUIT with illegal password for faction %s: %s\n", factionid(f), buffer); + log_warning("QUIT with illegal password for faction %s: %s\n", itoa36(f->no), buffer); } return 0; } diff --git a/src/modules/score.c b/src/modules/score.c index 89cf90655..8213b8985 100644 --- a/src/modules/score.c +++ b/src/modules/score.c @@ -169,7 +169,7 @@ void score(void) fprintf(scoreFP, "%30.30s (%3.3s) %5s (%3d)\n", f->name, f->race->_name, - factionid(f), + itoa36(f->no), f->age); } fclose(scoreFP); diff --git a/src/report.c b/src/report.c index b3549302a..569674403 100644 --- a/src/report.c +++ b/src/report.c @@ -1406,7 +1406,7 @@ report_template(const char *filename, report_context * ctx, const char *charset) newline(out); newline(out); - sprintf(buf, "%s %s \"password\"", LOC(f->locale, "ERESSEA"), factionid(f)); + sprintf(buf, "%s %s \"password\"", LOC(f->locale, "ERESSEA"), itoa36(f->no)); rps_nowrap(out, buf); newline(out); newline(out); diff --git a/src/reports.c b/src/reports.c index 837ea1a31..fa39f0a85 100644 --- a/src/reports.c +++ b/src/reports.c @@ -140,7 +140,7 @@ static char *groupid(const struct group *g, const struct faction *f) static name idbuf[8]; static int nextbuf = 0; char *buf = idbuf[(++nextbuf) % 8]; - sprintf(buf, "%s (%s)", g->name, factionid(f)); + sprintf(buf, "%s (%s)", g->name, itoa36(f->no)); return buf; } @@ -1418,7 +1418,7 @@ int write_reports(faction * f, time_t ltime) do { char filename[32]; char path[MAX_PATH]; - sprintf(filename, "%d-%s.%s", turn, factionid(f), + sprintf(filename, "%d-%s.%s", turn, itoa36(f->no), rtype->extension); join_path(reportpath(), filename, path, sizeof(path)); errno = 0; @@ -1441,7 +1441,7 @@ int write_reports(faction * f, time_t ltime) } } if (!gotit) { - log_warning("No report for faction %s!", factionid(f)); + log_warning("No report for faction %s!", itoa36(f->no)); } finish_reports(&ctx); return 0; @@ -1452,7 +1452,7 @@ static void write_script(FILE * F, const faction * f) report_type *rtype; char buf[1024]; - fprintf(F, "faction=%s:email=%s:lang=%s", factionid(f), f->email, + fprintf(F, "faction=%s:email=%s:lang=%s", itoa36(f->no), f->email, locale_name(f->locale)); if (f->options & (1 << O_BZIP2)) fputs(":compression=bz2", F); diff --git a/src/summary.c b/src/summary.c index 8e9dea65d..b82c3a50e 100644 --- a/src/summary.c +++ b/src/summary.c @@ -96,12 +96,12 @@ int update_nmrs(void) int nmr = turn - f->lastorders + 1; if (timeout>0) { if (nmr < 0 || nmr > timeout) { - log_error("faction %s has %d NMR", factionid(f), nmr); + log_error("faction %s has %d NMR", itoa36(f->no), nmr); nmr = _max(0, nmr); nmr = _min(nmr, timeout); } if (nmr > 0) { - log_debug("faction %s has %d NMR", factionid(f), nmr); + log_debug("faction %s has %d NMR", itoa36(f->no), nmr); } ++nmrs[nmr]; }