unit::botschaften as a special case of messages disappears. Simple code for simple stuff.

This commit is contained in:
Enno Rehling 2005-07-25 19:56:44 +00:00
parent 191fb45b18
commit 32852df60c
10 changed files with 21 additions and 43 deletions

View File

@ -899,9 +899,6 @@ cr_output_unit(FILE * F, const region * r,
}
}
if ((u->faction == f || omniscient(f)) && u->botschaften)
cr_output_str_list(F, "EINHEITSBOTSCHAFTEN", u->botschaften, f);
print_curses(F, f, u, TYP_UNIT);
}
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */

View File

@ -2126,7 +2126,7 @@ expandselling(region * r, request * sellorders, int limit)
change_money(maxowner, (int) taxcollected);
add_income(maxowner, IC_TRADETAX, taxcollected, taxcollected);
/* TODO: Meldung
* sprintf(buf, "%s verdient %d Silber durch den Handel in %s.",
* "%s verdient %d Silber durch den Handel in %s.",
* unitname(maxowner), (int) taxcollected, regionname(r)); */
}
}

View File

@ -1791,17 +1791,13 @@ name_cmd(unit * u, struct order * ord)
static void
deliverMail(faction * f, region * r, unit * u, const char *s, unit * receiver)
{
if (!receiver) { /* BOTSCHAFT an PARTEI */
add_message(&f->msgs,
msg_message("unitmessage", "region unit string", r, u, s));
if (!cansee(f, r, u, 0)) {
u = NULL;
}
else { /* BOTSCHAFT an EINHEIT */
unit *emp = receiver;
if (cansee(f, r, u, 0))
sprintf(buf, "Eine Botschaft von %s: '%s'", unitname(u), s);
else
sprintf(buf, "Eine anonyme Botschaft: '%s'", s);
addstrlist(&emp->botschaften, strdup(buf));
if (!receiver) { /* BOTSCHAFT an PARTEI */
ADDMSG(&f->msgs, msg_message("regionmessage", "region sender string", r, u, s));
} else { /* BOTSCHAFT an EINHEIT */
ADDMSG(&f->msgs, msg_message("unitmessage", "region unit sender string", r, receiver, u, s));
}
}

View File

@ -787,25 +787,6 @@ rpunit(FILE * F, const faction * f, const unit * u, int indent, int mode)
print_curses(F, f, u, TYP_UNIT, indent);
}
#ifdef USE_UGROUPS
if(ug) {
int i;
for(i=0; i<ug->members; i++) {
if (mode==see_unit && ug->unit_array[i]->faction == f && ug->unit_array[i]->botschaften) {
for (S = ug->unit_array[i]->botschaften; S; S = S->next) {
rnl(F);
rparagraph(F, S->s, indent, 0);
}
}
}
} else
#endif
if (mode==see_unit && u->faction == f && u->botschaften) {
for (S = u->botschaften; S; S = S->next) {
rnl(F);
rparagraph(F, S->s, indent, 0);
}
}
}
static void

View File

@ -525,8 +525,6 @@ unitorders(FILE * F, struct faction * f)
}
}
u->botschaften = NULL; /* Sicherheitshalber */
} else {
/* cmistake(?, buf, 160, MSG_EVENT); */
return NULL;

View File

@ -1141,7 +1141,6 @@ stripunit(unit * u)
free(u->name);
free(u->display);
free_orders(&u->orders);
freestrlist(u->botschaften);
if(u->skills) free(u->skills);
while (u->items) {
item * it = u->items->next;

View File

@ -113,7 +113,6 @@ typedef struct unit {
const struct race * race;
const struct race * irace;
struct strlist *botschaften;
unsigned int flags;
struct attrib * attribs;
status_t status;

View File

@ -444,7 +444,7 @@ gm_messageunit(const tnode * tnext, const char * str, void * data, struct order
}
else {
add_message(&target->faction->msgs,
msg_message("unitmessage", "region unit string", r, u, msg));
msg_message("regionmessage", "region sender string", r, u, msg));
}
}
}

View File

@ -312,8 +312,7 @@ use_museumexitticket(unit *u, const struct item_type *itype, int amount, order *
for(it = gb->items; it; it = it->next) {
i_change(&u->items, it->type, it->number);
}
sprintf(buf, "von %s: 'Hier habt ihr eure Sachen zurück.'", unitname(warden));
addstrlist(&u->botschaften, buf);
ADDMSG(&u->faction->msgs, msg_message("unitmessage", "region unit sender string", r, u, warden, buf));
a_remove(&warden->attribs, a);
}
}

View File

@ -604,15 +604,24 @@
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - $race($race,0) do not give things away."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $race($race,0) do not give things away."</text>
</message>
<message name="regionmessage" section="events">
<type>
<arg name="sender" type="unit"/>
<arg name="region" type="region"/>
<arg name="string" type="string"/>
</type>
<text locale="de">"Eine Botschaft von $unit($sender) aus $region($region): '$string'"</text>
<text locale="en">"A message by $unit($sender) from $region($region): '$string'"</text>
</message>
<message name="unitmessage" section="events">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="string" type="string"/>
<arg name="sender" type="unit"/>
</type>
<text locale="de">"Eine Botschaft von $unit($unit) aus $region($region): '$string'"</text>
<text locale="fr">"A message by $unit($unit) from $region($region): '$string'"</text>
<text locale="en">"A message by $unit($unit) from $region($region): '$string'"</text>
<text locale="de">"In $region($region) erhielt $unit($unit) eine Botschaft von $unit($sender): '$string'"</text>
<text locale="en">"In $region($region), $unit($unit) received a message by $unit($sender): '$string'"</text>
</message>
<message name="maintenance_nowork" section="events">
<type>