new_message is deprecated, replacing it with msg_message

This commit is contained in:
Enno Rehling 2005-05-09 20:29:27 +00:00
parent e2d87d2b2a
commit 903633060a
2 changed files with 26 additions and 29 deletions

View File

@ -260,9 +260,8 @@ siege_cmd(unit * u, order * ord)
} else d = 0; } else d = 0;
/* meldung fuer belagerer */ /* meldung fuer belagerer */
add_message(&u->faction->msgs, ADDMSG(&u->faction->msgs, msg_message("siege",
new_message(u->faction, "siege%u:unit%b:building%i:destruction", "unit building destruction", u, b, d));
u, b, d));
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH); for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
@ -271,9 +270,8 @@ siege_cmd(unit * u, order * ord)
for (u2 = r->units; u2; u2 = u2->next) { for (u2 = r->units; u2; u2 = u2->next) {
if (u2->building == b && !fval(u2->faction, FL_DH)) { if (u2->building == b && !fval(u2->faction, FL_DH)) {
fset(u2->faction, FL_DH); fset(u2->faction, FL_DH);
add_message(&u2->faction->msgs, ADDMSG(&u2->faction->msgs, msg_message("siege",
new_message(u2->faction, "siege%u:unit%b:building%i:destruction", "unit building destruction", u, b, d));
u, b, d));
} }
} }
} }
@ -332,8 +330,8 @@ destroy_road(unit *u, int n, struct order * ord)
#endif #endif
rsetroad(r, d, road - willdo); rsetroad(r, d, road - willdo);
if (road!=0 && road <= willdo) { if (road!=0 && road <= willdo) {
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("destroy_road",
u->faction, "destroy_road%u:unit%r:from%r:to", u, r, r2)); "unit from to", u, r, r2));
} }
} }
} }
@ -401,14 +399,14 @@ destroy_cmd(unit * u, struct order * ord)
u2->building = 0; u2->building = 0;
freset(u2, UFL_OWNER); freset(u2, UFL_OWNER);
} }
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("destroy",
u->faction, "destroy%b:building%u:unit", b, u)); "building unit", b, u));
destroy_building(b); destroy_building(b);
} else { } else {
/* partial destroy */ /* partial destroy */
b->size -= n; b->size -= n;
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("destroy_partial",
u->faction, "destroy_partial%b:building%u:unit", b, u)); "building unit", b, u));
} }
} else if (u->ship) { } else if (u->ship) {
sh = u->ship; sh = u->ship;
@ -435,14 +433,14 @@ destroy_cmd(unit * u, struct order * ord)
u2->ship = 0; u2->ship = 0;
freset(u2, UFL_OWNER); freset(u2, UFL_OWNER);
} }
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("shipdestroy",
u->faction, "shipdestroy%u:unit%r:region%h:ship", u, r, sh)); "unit region ship", u, r, sh));
destroy_ship(sh); destroy_ship(sh);
} else { } else {
/* partial destroy */ /* partial destroy */
sh->size -= (sh->type->construction->maxsize * n)/100; sh->size -= (sh->type->construction->maxsize * n)/100;
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("shipdestroy_partial",
u->faction, "shipdestroy_partial%u:unit%r:region%h:ship", u, r, sh)); "unit region ship", u, r, sh));
} }
} else { } else {
log_error(("Die Einheit %s von %s war owner eines objects, war aber weder in einer Burg noch in einem Schiff.\n", log_error(("Die Einheit %s von %s war owner eines objects, war aber weder in einer Burg noch in einem Schiff.\n",
@ -568,8 +566,8 @@ build_road(region * r, unit * u, int size, direction_t d)
/* Nur soviel PRODUCEEXP wie auch tatsaechlich gemacht wurde */ /* Nur soviel PRODUCEEXP wie auch tatsaechlich gemacht wurde */
produceexp(u, SK_ROAD_BUILDING, min(n, u->number)); produceexp(u, SK_ROAD_BUILDING, min(n, u->number));
} }
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("buildroad",
u->faction, "buildroad%r:region%u:unit%i:size", r, u, n)); "region unit size", r, u, n));
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
@ -941,8 +939,8 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
b->size += built; b->size += built;
update_lighthouse(b); update_lighthouse(b);
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("buildbuilding",
u->faction, "buildbuilding%b:building%u:unit%i:size", b, u, built)); "building unit size", b, u, built));
} }
static void static void
@ -977,9 +975,8 @@ build_ship(unit * u, ship * sh, int want)
sh->damage = sh->damage - repair; sh->damage = sh->damage - repair;
} }
if(n) if (n) ADDMSG(&u->faction->msgs,
add_message(&u->faction->msgs, new_message( msg_message("buildship", "ship unit size", sh, u, n));
u->faction, "buildship%h:ship%u:unit%i:size", sh, u, n));
} }
void void

View File

@ -470,8 +470,8 @@ do_maelstrom(region *r, unit *u)
damage = rand()%150 - eff_skill(u, SK_SAILING, r)*5; damage = rand()%150 - eff_skill(u, SK_SAILING, r)*5;
if(damage <= 0) { if(damage <= 0) {
add_message(&u->faction->msgs, ADDMSG(&u->faction->msgs, msg_message("entermaelstrom",
new_message(u->faction, "entermaelstrom%r:region%h:ship%i:damage%i:sink", r, u->ship, damage, 1)); "region ship damage sink", r, u->ship, damage, 1));
return u->ship; return u->ship;
} }
@ -2054,14 +2054,14 @@ piracy_cmd(unit *u, struct order * ord)
/* Wenn kein Ziel gefunden, entsprechende Meldung generieren */ /* Wenn kein Ziel gefunden, entsprechende Meldung generieren */
if (target_dir == NODIRECTION) { if (target_dir == NODIRECTION) {
add_message(&u->faction->msgs, ADDMSG(&u->faction->msgs, msg_message("piratenovictim",
new_message(u->faction, "piratenovictim%h:ship%r:region", sh, r)); "ship region", sh, r));
return; return;
} }
/* Meldung generieren */ /* Meldung generieren */
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message("piratesawvictim",
"piratesawvictim%h:ship%r:region%d:dir", sh, r, target_dir)); "ship region dir", sh, r, target_dir));
/* Befehl konstruieren */ /* Befehl konstruieren */
sprintf(buf, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]), sprintf(buf, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]),