]> git.pond.sub.org Git - empserver/commitdiff
Use relations_with() in nav_loadship()
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 30 Jan 2011 16:10:43 +0000 (17:10 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 16 Feb 2011 06:55:24 +0000 (07:55 +0100)
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.

src/lib/update/nav_ship.c

index 4c97d5657ff0dba579ea56fed819ac0c9b05dd50..7dc0c7ce4979d8bb0331a1a34365acbffd3772ee 100644 (file)
@@ -160,7 +160,7 @@ nav_loadship(struct shpstr *sp)
     if (!(sectp = getsectp(sp->shp_x, sp->shp_y)))
        return 0;               /* safety */
 
     if (!(sectp = getsectp(sp->shp_x, sp->shp_y)))
        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 */
     for (i = 0; i < TMAX; ++i) {
 
     /* loop through each field for that ship */
     for (i = 0; i < TMAX; ++i) {
@@ -181,7 +181,7 @@ nav_loadship(struct shpstr *sp)
            didsomething[i] = 1;
            continue;
        }
            didsomething[i] = 1;
            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);
     }