the unitid macro is boring.

This commit is contained in:
Enno Rehling 2016-11-17 21:27:19 +01:00
parent bc5e744347
commit 434cf8fce6
6 changed files with 9 additions and 11 deletions

View File

@ -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);
}
}

View File

@ -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)

View File

@ -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) {

View File

@ -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:

View File

@ -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,

View File

@ -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 {