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/follow.h>
#include <attributes/targetregion.h> #include <attributes/targetregion.h>
#include <attributes/at_movement.h> #include <attributes/at_movement.h>
#include <attributes/otherfaction.h>
extern border_type bt_wisps; extern border_type bt_wisps;
int * storms; int * storms;
@ -2037,14 +2038,18 @@ piracy_cmd(unit *u, struct order * ord)
for(dir = 0; dir < MAXDIRECTIONS; dir++) { for(dir = 0; dir < MAXDIRECTIONS; dir++) {
region *rc = rconnect(r, dir); region *rc = rconnect(r, dir);
aff[dir] = 0; aff[dir] = 0;
if(rc && (terrain[rterrain(rc)].flags & SWIM_INTO) if (rc && (terrain[rterrain(rc)].flags & SWIM_INTO)
&& check_takeoff(sh, r, rc) == true) { && check_takeoff(sh, r, rc) == true) {
for(sh2 = rc->ships; sh2; sh2 = sh2->next) { for (sh2 = rc->ships; sh2; sh2 = sh2->next) {
unit * cap = shipowner(sh2); unit * cap = shipowner(sh2);
if (cap && (intlist_find(il, cap->faction->no) || all)) { if (cap) {
aff[dir]++; 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. */ /* Und aufaddieren. */

View File

@ -879,20 +879,6 @@ ucansee(const struct faction *f, const struct unit *u, const struct unit *x)
return 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 * faction_list *
get_addresses(faction * f, struct seen_region * seehash[]) 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 #endif
extern const char * reportpath(void); 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 struct faction_list * get_addresses(struct faction * f, struct seen_region * seehash[]);
extern const char * trailinto(const struct region * r, const struct locale * lang); 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; return n;
} }
#endif #endif