Use relations_with() in unit_interdict()

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
This commit is contained in:
Markus Armbruster 2011-02-01 07:49:32 +01:00
parent 9100af0b82
commit 928e9a4cc3

View file

@ -187,10 +187,10 @@ unit_interdict(coord x, coord y, natid victim, char *s, int hardtarget,
memset(mi, 0, sizeof(mi)); memset(mi, 0, sizeof(mi));
other_act[0] = plane_act[0] = 0; other_act[0] = plane_act[0] = 0;
for (cn = 1; cn < MAXNOC; cn++) { for (cn = 1; cn < MAXNOC; cn++) {
rel = getrel(getnatp(cn), victim); rel = relations_with(cn, victim);
other_act[cn] = rel <= HOSTILE; other_act[cn] = rel <= HOSTILE;
plane_act[cn] = mission == MI_SINTERDICT 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]); emp_initque((struct emp_qelem *)&mi[cn]);
} }