diff --git a/src/lib/subs/aircombat.c b/src/lib/subs/aircombat.c index 2645eb69..29df52f1 100644 --- a/src/lib/subs/aircombat.c +++ b/src/lib/subs/aircombat.c @@ -618,7 +618,7 @@ ac_shipflak(struct emp_qelem *list, coord x, coord y) mcp = &mchr[(int)ship.shp_type]; if (mcp->m_flags & M_SUB) continue; - if (getrel(getnatp(ship.shp_own), plane_owner) > HOSTILE) + if (relations_with(ship.shp_own, plane_owner) > HOSTILE) continue; gun = shp_usable_guns(&ship); if (gun == 0) @@ -669,7 +669,7 @@ ac_landflak(struct emp_qelem *list, coord x, coord y) continue; if (land.lnd_ship >= 0 || land.lnd_land >= 0) continue; - if (getrel(getnatp(land.lnd_own), plane_owner) > HOSTILE) + if (relations_with(land.lnd_own, plane_owner) > HOSTILE) continue; flak = aaf * 1.5 * land.lnd_effic / 100.0; ngun += flak; diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index ab8e5895..bd612cc5 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -105,7 +105,7 @@ ground_interdict(coord x, coord y, natid victim, char *s) memset(mi, 0, sizeof(mi)); act[0] = 0; for (cn = 1; cn < MAXNOC; cn++) { - act[cn] = getrel(getnatp(cn), victim) <= HOSTILE; + act[cn] = relations_with(cn, victim) <= HOSTILE; emp_initque((struct emp_qelem *)&mi[cn]); } @@ -1041,7 +1041,7 @@ air_damage(struct emp_qelem *bombers, coord x, coord y, int mission, prplane(pp), xyas(x, y, pp->pln_own)); continue; } - if (getrel(getnatp(pp->pln_own), victim) > HOSTILE) { + if (relations_with(pp->pln_own, victim) > HOSTILE) { wu(0, pp->pln_own, "\t%s tracks %s %s at %s\n", prplane(pp), cname(victim), s, xyas(x, y, pp->pln_own)); diff --git a/src/lib/subs/mslsub.c b/src/lib/subs/mslsub.c index e7c03e5d..7a763c3b 100644 --- a/src/lib/subs/mslsub.c +++ b/src/lib/subs/mslsub.c @@ -199,7 +199,7 @@ msl_sel(struct emp_qelem *list, coord x, coord y, natid victim, if (mission && plane.pln_radius < mapdist(x, y, plane.pln_opx, plane.pln_opy)) continue; - if (getrel(getnatp(plane.pln_own), victim) >= NEUTRAL) + if (relations_with(plane.pln_own, victim) >= NEUTRAL) continue; /* missiles go one way, so we can use all the range */ if (plane.pln_range < mapdist(x, y, plane.pln_x, plane.pln_y)) diff --git a/src/lib/subs/nreport.c b/src/lib/subs/nreport.c index 13216b88..f2d01dc6 100644 --- a/src/lib/subs/nreport.c +++ b/src/lib/subs/nreport.c @@ -84,7 +84,7 @@ nreport(natid actor, int event, natid victim, int times) return; if (!chance((double)-nice * times / 20.0)) return; - if (getrel(getnatp(victim), actor) < HOSTILE) + if (relations_with(victim, actor) < HOSTILE) return; setrel(victim, actor, HOSTILE); diff --git a/src/lib/subs/shpsub.c b/src/lib/subs/shpsub.c index 5883d2ba..d18316a9 100644 --- a/src/lib/subs/shpsub.c +++ b/src/lib/subs/shpsub.c @@ -611,7 +611,7 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy, return 0; /* Only coastwatch notify in nofortfire */ /* Only fire at Hostile ships */ for (i = 0; i < MAXNOC; ++i) { - if (getrel(getnatp(i), victim) >= NEUTRAL) + if (relations_with(i, victim) >= NEUTRAL) notified[i] = 0; } snxtsct_dist(&ns, newx, newy, fort_max_interdiction_range); @@ -849,7 +849,7 @@ shp_missile_defense(coord dx, coord dy, natid bombown, int hardtarget) if (!(mchr[(int)ship.shp_type].m_flags & M_ANTIMISSILE)) continue; - if (getrel(getnatp(ship.shp_own), bombown) >= NEUTRAL) + if (relations_with(ship.shp_own, bombown) >= NEUTRAL) continue; if (ship.shp_effic < 60)