Use relations_with() in nav_loadship()

No functional change, because the value of rel only matters when
sectp->sct_own != sp->shp_own, and then it's the same as before.

The new value of rel permits simplifying sectp->sct_own == sp->shp_own
|| rel >= FRIENDLY to just rel >= FRIENDLY.
This commit is contained in:
Markus Armbruster 2011-01-30 17:10:43 +01:00
parent 983dae641c
commit 58cc82589e

View file

@ -160,7 +160,7 @@ nav_loadship(struct shpstr *sp)
if (!(sectp = getsectp(sp->shp_x, sp->shp_y))) if (!(sectp = getsectp(sp->shp_x, sp->shp_y)))
return 0; /* safety */ return 0; /* safety */
rel = getrel(getnatp(sectp->sct_own), sp->shp_own); rel = relations_with(sectp->sct_own, sp->shp_own);
/* loop through each field for that ship */ /* loop through each field for that ship */
for (i = 0; i < TMAX; ++i) { for (i = 0; i < TMAX; ++i) {
@ -181,7 +181,7 @@ nav_loadship(struct shpstr *sp)
didsomething[i] = 1; didsomething[i] = 1;
continue; continue;
} }
if (sectp->sct_own == sp->shp_own || rel >= FRIENDLY) if (rel >= FRIENDLY)
didsomething[i] = load_it(sp, sectp, i); didsomething[i] = load_it(sp, sectp, i);
} }