diff --git a/src/battle.c b/src/battle.c index 34d4618a5..b5d767535 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1216,7 +1216,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile) while (chance(kritchance)) { if (bdebug) { - fprintf(bdebug, "%s/%d lands a critical hit\n", unitid(au), at.index); + fprintf(bdebug, "%s/%d lands a critical hit\n", itoa36(au->no), at.index); } da += dice_rand(damage); } @@ -1980,10 +1980,10 @@ debug_hit(troop at, const weapon * awp, troop dt, const weapon * dwp, int skdiff, int dist, bool success) { fprintf(bdebug, "%.4s/%d [%6s/%d] %s %.4s/%d [%6s/%d] with %d, distance %d\n", - unitid(at.fighter->unit), at.index, + itoa36(at.fighter->unit->no), at.index, LOC(default_locale, awp ? resourcename(awp->type->itype->rtype, 0) : "unarmed"), weapon_effskill(at, dt, awp, true, dist > 1), - success ? "hits" : "misses", unitid(dt.fighter->unit), dt.index, + success ? "hits" : "misses", itoa36(dt.fighter->unit->no), dt.index, LOC(default_locale, dwp ? resourcename(dwp->type->itype->rtype, 0) : "unarmed"), weapon_effskill(dt, at, dwp, false, dist > 1), skdiff, dist); @@ -2194,7 +2194,7 @@ static void attack(battle * b, troop ta, const att * a, int numattack) if (reload && wp && wp->type->reload && !getreload(ta)) { int i = setreload(ta); if (bdebug) { - fprintf(bdebug, "%s/%d reloading %d turns\n", unitid(au), + fprintf(bdebug, "%s/%d reloading %d turns\n", itoa36(au->no), ta.index, i); } } diff --git a/src/kernel/config.h b/src/kernel/config.h index fd929e8f7..2f36f6bc9 100644 --- a/src/kernel/config.h +++ b/src/kernel/config.h @@ -45,8 +45,6 @@ struct param; bool isparam(const char *s, const struct locale * lang, param_t param); param_t getparam(const struct locale *lang); -#define unitid(x) itoa36((x)->no) - #define buildingid(x) itoa36((x)->no) #define shipid(x) itoa36((x)->no) #define factionid(x) itoa36((x)->no) diff --git a/src/report.c b/src/report.c index 80ac85974..b3549302a 100644 --- a/src/report.c +++ b/src/report.c @@ -1453,7 +1453,7 @@ report_template(const char *filename, report_context * ctx, const char *charset) size = sizeof(buf) - 1; bytes = _snprintf(bufp, size, "%s %s; %s [%d,%d$", LOC(u->faction->locale, parameters[P_UNIT]), - unitid(u), unit_getname(u), u->number, get_money(u)); + itoa36(u->no), unit_getname(u), u->number, get_money(u)); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); if (u->building && building_owner(u->building) == u) { diff --git a/src/spells.c b/src/spells.c index da2b73c5e..369dab924 100644 --- a/src/spells.c +++ b/src/spells.c @@ -6291,7 +6291,7 @@ int sp_q_antimagie(castorder * co) { unit *u = pa->param[0]->data.u; ap = &u->attribs; - ts = unitid(u); + ts = itoa36(u->no); break; } case SPP_BUILDING: @@ -6384,7 +6384,7 @@ int sp_break_curse(castorder * co) { unit *u = pa->param[0]->data.u; ap = &u->attribs; - ts = unitid(u); + ts = itoa36(u->no); break; } case SPP_BUILDING: diff --git a/src/study.c b/src/study.c index 1cd8847be..1dd4da8b8 100644 --- a/src/study.c +++ b/src/study.c @@ -439,7 +439,7 @@ int teach_cmd(unit * u, struct order *ord) strncat(zOrder, " ", sz - 1); --sz; } - sz -= strlcpy(zOrder + 4096 - sz, unitid(u2), sz); + sz -= strlcpy(zOrder + 4096 - sz, itoa36(u2->no), sz); if (getkeyword(u2->thisorder) != K_STUDY) { ADDMSG(&u->faction->msgs, diff --git a/src/triggers/shock.c b/src/triggers/shock.c index 75904e346..f44219b5f 100644 --- a/src/triggers/shock.c +++ b/src/triggers/shock.c @@ -118,7 +118,7 @@ static void shock_write(const trigger * t, struct storage *store) next = next->next; } if (next && u) { - log_error("more than one shock-attribut for %s on a unit. FIXED.\n", unitid(u)); + log_error("more than one shock-attribut for %s on a unit. FIXED.\n", itoa36(u->no)); write_unit_reference(NULL, store); } else {