- Diebstahl von Leuten in derselben Allianz nicht mehr möglich.

This commit is contained in:
Christian Schlittchen 2002-10-05 14:35:04 +00:00
parent 5ac7444692
commit 7ef6724321
5 changed files with 32 additions and 6 deletions

View File

@ -852,7 +852,7 @@ cr_find_address(FILE * F, const faction * uf, const faction_list * addresses)
fprintf(F, "\"%s\";email\n", f->email); fprintf(F, "\"%s\";email\n", f->email);
fprintf(F, "\"%s\";banner\n", f->banner); fprintf(F, "\"%s\";banner\n", f->banner);
#ifdef ALLIANCES #ifdef ALLIANCES
if (f->alliance!=NULL) { if (f->alliance!=NULL && f->alliance==uf->alliance) {
fprintf(F, "%d;alliance\n", f->alliance->id); fprintf(F, "%d;alliance\n", f->alliance->id);
fprintf(F, "\"%s\";alliancename\n", f->alliance->name); fprintf(F, "\"%s\";alliancename\n", f->alliance->name);
} }

View File

@ -2924,15 +2924,23 @@ steal(region * r, unit * u, request ** stealorders)
if (u2->faction->age < IMMUN_GEGEN_ANGRIFF) { if (u2->faction->age < IMMUN_GEGEN_ANGRIFF) {
add_message(&u->faction->msgs, add_message(&u->faction->msgs,
msg_error(u, findorder(u, u->thisorder), "newbie_immunity_error", "turns", IMMUN_GEGEN_ANGRIFF)); msg_error(u, findorder(u, u->thisorder), "newbie_immunity_error",
"turns", IMMUN_GEGEN_ANGRIFF));
return;
}
if(u->faction->alliance == u2->faction->alliance) {
cmistake(u, findorder(u, u->thisorder), 47, MSG_INCOME);
return; return;
} }
assert(u->region==u2->region); assert(u->region==u2->region);
if (!can_contact(r, u, u2)) { if (!can_contact(r, u, u2)) {
add_message(&u->faction->msgs, msg_error(u, findorder(u, u->thisorder), "error60", "")); add_message(&u->faction->msgs, msg_error(u, findorder(u, u->thisorder),
"error60", ""));
return; return;
} }
n = eff_skill(u, SK_STEALTH, r) - wahrnehmung(r, f); n = eff_skill(u, SK_STEALTH, r) - wahrnehmung(r, f);
if (n == 0) { if (n == 0) {

View File

@ -1811,7 +1811,7 @@ list_address(FILE * F, const faction * uf, const faction_list * seenfactions)
const faction * f = flist->data; const faction * f = flist->data;
if (f->no!=MONSTER_FACTION) { if (f->no!=MONSTER_FACTION) {
sprintf(buf, "%s: %s; %s", factionname(f), f->email, f->banner); sprintf(buf, "%s: %s; %s", factionname(f), f->email, f->banner);
rparagraph(F, buf, 4, '*'); rparagraph(F, buf, 4, (uf->alliance != NULL && f->alliance != NULL && uf->alliance == f->alliance)?'+':'*');
} }
flist = flist->next; flist = flist->next;
} }

View File

@ -114,7 +114,7 @@ ursprung_x(const faction *f, const plane *pl, const region * rdefault)
return ur->x; return ur->x;
} }
if (!rdefault) return 0; if (!rdefault) return 0;
set_ursprung((faction*)f, pl->id, rdefault->x - plane_center_x(pl), rdefault->y - plane_center_y(pl)); set_ursprung((faction*)f, id, rdefault->x - plane_center_x(pl), rdefault->y - plane_center_y(pl));
return rdefault->x - plane_center_x(pl); return rdefault->x - plane_center_x(pl);
} }

View File

@ -857,6 +857,7 @@ faction_list *
get_addresses(const faction * f, const seen_region * seenregions) get_addresses(const faction * f, const seen_region * seenregions)
{ {
/* "TODO: travelthru" */ /* "TODO: travelthru" */
faction *f2;
const seen_region * sr = seenregions; const seen_region * sr = seenregions;
const faction * lastf = NULL; const faction * lastf = NULL;
faction_list * flist = calloc(1, sizeof(faction_list)); faction_list * flist = calloc(1, sizeof(faction_list));
@ -866,7 +867,8 @@ get_addresses(const faction * f, const seen_region * seenregions)
const unit * u = r->units; const unit * u = r->units;
while (u!=NULL) { while (u!=NULL) {
faction * sf = visible_faction(f, u); faction * sf = visible_faction(f, u);
if (sf && sf!=f && sf!=lastf && !fval(u, FL_PARTEITARNUNG) && cansee(f, r, u, 0)) { if (sf && sf!=f && sf!=lastf && ((!fval(u, FL_PARTEITARNUNG) && cansee(f, r, u, 0))
|| (f->alliance != NULL && sf->alliance != NULL && f->alliance == sf->alliance))) {
faction_list ** fnew = &flist; faction_list ** fnew = &flist;
while (*fnew && (*fnew)->data->no < sf->no) { while (*fnew && (*fnew)->data->no < sf->no) {
fnew =&(*fnew)->next; fnew =&(*fnew)->next;
@ -883,5 +885,21 @@ get_addresses(const faction * f, const seen_region * seenregions)
} }
sr = sr->next; sr = sr->next;
} }
if(f->alliance != NULL) {
for(f2 = factions; f2; f2 = f2->next) {
if(f2->alliance != NULL && f2->alliance == f->alliance) {
faction_list ** fnew = &flist;
while (*fnew && (*fnew)->data->no < f2->no) {
fnew =&(*fnew)->next;
}
if ((*fnew==NULL) || (*fnew)->data!=f2) {
faction_list * finsert = malloc(sizeof(faction_list));
finsert->next = *fnew;
*fnew = finsert;
finsert->data = f2;
}
}
}
}
return flist; return flist;
} }