remove duplication, fix a stray blank space in the NR.

This commit is contained in:
Enno Rehling 2015-08-07 16:17:11 +02:00
parent 816243d2d7
commit 398579c293
2 changed files with 8 additions and 12 deletions

View File

@ -515,33 +515,29 @@ nr_curses_i(stream *out, int indent, const faction *viewer, objtype_t typ, const
{ {
for (; a; a = a->next) { for (; a; a = a->next) {
char buf[4096]; char buf[4096];
message *msg; message *msg = 0;
if (fval(a->type, ATF_CURSE)) { if (fval(a->type, ATF_CURSE)) {
curse *c = (curse *)a->data.v; curse *c = (curse *)a->data.v;
self = curse_cansee(c, viewer, typ, obj, self); self = curse_cansee(c, viewer, typ, obj, self);
msg = msg_curse(c, obj, typ, self); msg = msg_curse(c, obj, typ, self);
if (msg) {
newline(out);
nr_render(msg, viewer->locale, buf, sizeof(buf), viewer);
paragraph(out, buf, indent, 2, 0);
msg_release(msg);
}
} }
else if (a->type == &at_effect && self) { else if (a->type == &at_effect && self) {
effect_data *data = (effect_data *)a->data.v; effect_data *data = (effect_data *)a->data.v;
if (data->value > 0) { if (data->value > 0) {
msg = msg_message("nr_potion_effect", "potion left", msg = msg_message("nr_potion_effect", "potion left",
data->type->itype->rtype, data->value); data->type->itype->rtype, data->value);
}
}
if (msg) {
newline(out);
nr_render(msg, viewer->locale, buf, sizeof(buf), viewer); nr_render(msg, viewer->locale, buf, sizeof(buf), viewer);
paragraph(out, buf, indent, 2, 0); paragraph(out, buf, indent, 2, 0);
msg_release(msg); msg_release(msg);
} }
} }
} }
}
static void nr_curses(stream *out, int indent, const faction *viewer, objtype_t typ, const void *obj) static void nr_curses(stream *out, int indent, const faction *viewer, objtype_t typ, const void *obj)
{ {