piraterie: eigene boote verfolgen sich?

Ab sofort verfolgt man nur noch Boote von Leuten, denen man nicht HELFE BEWACHE gesetzt hat.

Issue: 464
This commit is contained in:
Enno Rehling 2005-06-06 20:08:20 +00:00
parent 0050b6d11f
commit 5ddee57978
4 changed files with 11 additions and 20 deletions

View File

@ -61,6 +61,7 @@
#include <attributes/follow.h>
#include <attributes/targetregion.h>
#include <attributes/at_movement.h>
#include <attributes/otherfaction.h>
extern border_type bt_wisps;
int * storms;
@ -2042,10 +2043,14 @@ piracy_cmd(unit *u, struct order * ord)
for (sh2 = rc->ships; sh2; sh2 = sh2->next) {
unit * cap = shipowner(sh2);
if (cap && (intlist_find(il, cap->faction->no) || all)) {
if (cap) {
faction * f = visible_faction(cap->faction, cap);
if (alliedunit(u, f, HELP_GUARD)) continue;
if (all || intlist_find(il, cap->faction->no)) {
aff[dir]++;
}
}
}
/* Und aufaddieren. */
saff += aff[dir];

View File

@ -879,20 +879,6 @@ ucansee(const struct faction *f, const struct unit *u, const struct unit *x)
return x;
}
faction *
visible_faction(const faction *f, const unit * u)
{
if (!alliedunit(u, f, HELP_FSTEALTH)) {
attrib *a = a_find(u->attribs, &at_otherfaction);
if (a) {
faction *fv = get_otherfaction(a);
assert (fv != NULL); /* fv should never be NULL! */
return fv;
}
}
return u->faction;
}
faction_list *
get_addresses(faction * f, struct seen_region * seehash[])
{

View File

@ -97,7 +97,6 @@ extern int bufunit_ugroupleader(const struct faction * f, const struct unit * u,
#endif
extern const char * reportpath(void);
extern struct faction * visible_faction(const struct faction *f, const struct unit * u);
extern struct faction_list * get_addresses(struct faction * f, struct seen_region * seehash[]);
extern const char * trailinto(const struct region * r, const struct locale * lang);

View File

@ -1166,4 +1166,5 @@ countheroes(const struct faction * f)
}
return n;
}
#endif