]> git.pond.sub.org Git - empserver/commitdiff
Use relations_with() in unit_interdict()
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 1 Feb 2011 06:49:32 +0000 (07:49 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 18 Feb 2011 17:46:04 +0000 (18:46 +0100)
No functional change, because the value of rel only matters when cn !=
victim, and then it's the same as before.

The new value of rel permits simplifying cn != victim && rel <=
NEUTRAL to just rel <= NEUTRAL

src/lib/subs/mission.c

index bd612cc50c65150f4c2d5fd0baefe2b26e5f8613..35652347078a5784dfb37777ef5c4ef060f78b05 100644 (file)
@@ -187,10 +187,10 @@ unit_interdict(coord x, coord y, natid victim, char *s, int hardtarget,
     memset(mi, 0, sizeof(mi));
     other_act[0] = plane_act[0] = 0;
     for (cn = 1; cn < MAXNOC; cn++) {
-       rel = getrel(getnatp(cn), victim);
+       rel = relations_with(cn, victim);
        other_act[cn] = rel <= HOSTILE;
        plane_act[cn] = mission == MI_SINTERDICT
-           ? cn != victim && rel <= NEUTRAL : other_act[cn];
+           ? rel <= NEUTRAL : other_act[cn];
        emp_initque((struct emp_qelem *)&mi[cn]);
     }