Bug 2614: Einheiten bewachen Region vor sich selbst.

This commit is contained in:
Enno Rehling 2019-10-20 17:11:58 +02:00
parent 1309b81879
commit d9cbbd9052
2 changed files with 4 additions and 5 deletions

View File

@ -607,9 +607,8 @@ static void allocate_resource(unit * u, const resource_type * rtype, int want)
if (itype->rtype && (itype->rtype == get_resourcetype(R_IRON) || itype->rtype == rt_find("laen"))) {
unit *u2;
for (u2 = r->units; u2; u2 = u2->next) {
if (is_guard(u)
&& !fval(u2, UFL_ISNEW)
&& u2->number && !alliedunit(u2, u->faction, HELP_GUARD)) {
if (!fval(u2, UFL_ISNEW) && u2->number
&& is_guard(u2) && !alliedunit(u2, u->faction, HELP_GUARD)) {
ADDMSG(&u->faction->msgs,
msg_feedback(u, u->thisorder, "region_guarded", "guard", u2));
return;

View File

@ -874,10 +874,10 @@ int build_island(int x, int y, int minsize, newfaction ** players, int numfactio
fset(r, RF_MARK);
if (r->land) {
if (nsize < minsize) {
nsize += random_neighbours(r, &rlist, &random_terrain, minsize - nsize);
nsize += random_neighbours(r, &rlist, random_terrain, minsize - nsize);
}
else {
nsize += random_neighbours(r, &rlist, &get_ocean, minsize - nsize);
nsize += random_neighbours(r, &rlist, get_ocean, minsize - nsize);
}
}
regionqueue_push(&island, r);