forked from github/server
- Einheiten mit otherfaction==u->faction
This commit is contained in:
parent
2079db13cf
commit
f55639c4e7
|
@ -645,8 +645,11 @@ cr_output_unit(FILE * F, const region * r,
|
||||||
if (sf!=u->faction) fprintf(F, "%d;Verkleidung\n", sf->no);
|
if (sf!=u->faction) fprintf(F, "%d;Verkleidung\n", sf->no);
|
||||||
if (fval(u, UFL_PARTEITARNUNG))
|
if (fval(u, UFL_PARTEITARNUNG))
|
||||||
fprintf(F, "%d;Parteitarnung\n", i2b(fval(u, UFL_PARTEITARNUNG)));
|
fprintf(F, "%d;Parteitarnung\n", i2b(fval(u, UFL_PARTEITARNUNG)));
|
||||||
if (otherfaction)
|
if (otherfaction) {
|
||||||
|
if (otherfaction!=u->faction) {
|
||||||
fprintf(F, "%d;Anderepartei\n", otherfaction->no);
|
fprintf(F, "%d;Anderepartei\n", otherfaction->no);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fval(u, UFL_PARTEITARNUNG)) {
|
if (fval(u, UFL_PARTEITARNUNG)) {
|
||||||
/* faction info is hidden */
|
/* faction info is hidden */
|
||||||
|
@ -659,9 +662,13 @@ cr_output_unit(FILE * F, const region * r,
|
||||||
if (sf == f) {
|
if (sf == f) {
|
||||||
fprintf(F, "1;Verraeter\n");
|
fprintf(F, "1;Verraeter\n");
|
||||||
}
|
}
|
||||||
if (a_otherfaction && alliedunit(u, f, HELP_FSTEALTH)) {
|
if (a_otherfaction) {
|
||||||
|
if (otherfaction!=u->faction) {
|
||||||
|
if (alliedunit(u, f, HELP_FSTEALTH)) {
|
||||||
fprintf(F, "%d;Anderepartei\n", otherfaction->no);
|
fprintf(F, "%d;Anderepartei\n", otherfaction->no);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
|
|
|
@ -2235,8 +2235,7 @@ display_item(faction *f, unit *u, const item_type * itype)
|
||||||
sprintf(filename, "%s/%s/items/%s", resourcepath(), locale_name(default_locale), name);
|
sprintf(filename, "%s/%s/items/%s", resourcepath(), locale_name(default_locale), name);
|
||||||
fp = fopen(filename, "r");
|
fp = fopen(filename, "r");
|
||||||
}
|
}
|
||||||
if (!fp) return false;
|
if (fp!=NULL) {
|
||||||
|
|
||||||
buf[0]='\0';
|
buf[0]='\0';
|
||||||
while (fgets(t, NAMESIZE, fp) != NULL) {
|
while (fgets(t, NAMESIZE, fp) != NULL) {
|
||||||
if (t[strlen(t) - 1] == '\n') {
|
if (t[strlen(t) - 1] == '\n') {
|
||||||
|
@ -2246,6 +2245,9 @@ display_item(faction *f, unit *u, const item_type * itype)
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
info = buf;
|
info = buf;
|
||||||
|
} else {
|
||||||
|
info = "Keine Informationen.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ADDMSG(&f->msgs, msg_message("displayitem", "weight item description",
|
ADDMSG(&f->msgs, msg_message("displayitem", "weight item description",
|
||||||
itype->weight/1000, itype->rtype, strdup(info)));
|
itype->weight/1000, itype->rtype, strdup(info)));
|
||||||
|
|
|
@ -482,6 +482,26 @@ fix_firewalls(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fix_otherfaction(void)
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
region * r;
|
||||||
|
for (r=regions;r;r=r->next) {
|
||||||
|
unit * u;
|
||||||
|
for (u=r->units;u;u=u->next) {
|
||||||
|
attrib * a = a_find(u->attribs, &at_otherfaction);
|
||||||
|
faction * f = (faction*)a->data.v;
|
||||||
|
if (f==u->faction) {
|
||||||
|
a_remove(&u->attribs, a);
|
||||||
|
++ncount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
r = r->next;
|
||||||
|
}
|
||||||
|
if (count) log_warning(("%u units had otherfaction=own faction.\n"));
|
||||||
|
}
|
||||||
|
|
||||||
extern attrib * make_atgmcreate(const struct item_type * itype);
|
extern attrib * make_atgmcreate(const struct item_type * itype);
|
||||||
extern attrib * make_atpermissions(void);
|
extern attrib * make_atpermissions(void);
|
||||||
extern struct attrib_type at_permissions;
|
extern struct attrib_type at_permissions;
|
||||||
|
@ -1093,6 +1113,7 @@ korrektur(void)
|
||||||
* to be on the safe side:
|
* to be on the safe side:
|
||||||
*/
|
*/
|
||||||
fix_demand();
|
fix_demand();
|
||||||
|
fix_otherfaction();
|
||||||
/* trade_orders(); */
|
/* trade_orders(); */
|
||||||
|
|
||||||
/* immer ausführen, wenn neue Sprüche dazugekommen sind, oder sich
|
/* immer ausführen, wenn neue Sprüche dazugekommen sind, oder sich
|
||||||
|
|
Loading…
Reference in New Issue