Just to make the next few commits easier to review.
xyas(sect.sct_x, sect.sct_y, player->cnum));
continue;
}
- if (!player->owner && load_unload == UNLOAD
+ if (load_unload == UNLOAD
+ && !player->owner
&& getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
if (noisy)
pr("You can't unload into an unfriendly %s\n",
continue;
if (sect.sct_type != SCT_HEADQ || sect.sct_effic < 60)
continue;
- if (getrel(getnatp(land.lnd_own), sect.sct_own) < FRIENDLY
- && sect.sct_own != land.lnd_own) {
+ if (land.lnd_own != sect.sct_own
+ && getrel(getnatp(land.lnd_own), sect.sct_own) < FRIENDLY) {
pr("You are not on friendly terms with the owner of unit %d!\n",
land.lnd_uid);
continue;
continue;
if (sect.sct_type != SCT_HARBR || sect.sct_effic < 60)
continue;
- if (getrel(getnatp(ship.shp_own), sect.sct_own) < FRIENDLY
- && sect.sct_own != ship.shp_own) {
+ if (ship.shp_own != sect.sct_own
+ && getrel(getnatp(ship.shp_own), sect.sct_own) < FRIENDLY) {
pr("You are not on friendly terms with the owner of ship %d!\n",
ship.shp_uid);
continue;
continue;
if (sect.sct_type != SCT_AIRPT || sect.sct_effic < 60)
continue;
- if (getrel(getnatp(plane.pln_own), sect.sct_own) < FRIENDLY
- && sect.sct_own != plane.pln_own) {
+ if (plane.pln_own != sect.sct_own
+ && getrel(getnatp(plane.pln_own), sect.sct_own) < FRIENDLY) {
pr("You are not on friendly terms with the owner of plane %d!\n",
plane.pln_uid);
continue;
lnd_stays(actor, "has no mil on it to guide it", llp);
continue;
}
- if (sect.sct_own != land.lnd_own &&
+ if (sect.sct_own != actor &&
getrel(getnatp(sect.sct_own), actor) != ALLIED &&
!(lchr[(int)llp->unit.land.lnd_type].l_flags & L_SPY) &&
sect.sct_own) {
while (nxtsct(&ns, &fsect)) {
if (fsect.sct_own == 0)
continue;
- if (fsect.sct_own == victim)
- continue;
- if (getrel(getnatp(fsect.sct_own), victim) >= NEUTRAL)
+ if (fsect.sct_own == victim
+ || getrel(getnatp(fsect.sct_own), victim) >= NEUTRAL)
continue;
range = roundrange(fortrange(&fsect));
trange = mapdist(newx, newy, fsect.sct_x, fsect.sct_y);
getsect(newx, newy, §);
navigate = shp_check_nav(§, &mlp->unit.ship);
if (navigate != CN_NAVIGABLE ||
- (sect.sct_own && actor != sect.sct_own &&
- getrel(getnatp(sect.sct_own), actor) < FRIENDLY)) {
+ (sect.sct_own
+ && sect.sct_own != actor
+ && getrel(getnatp(sect.sct_own), actor) < FRIENDLY)) {
if (dchr[sect.sct_type].d_nav == NAV_CANAL &&
!(((struct mchrstr *)mlp->chrp)->m_flags & M_CANAL) &&
navigate == CN_LANDLOCKED)
mp = &mchr[(int)ship->shp_type];
sp = getsectp(ship->shp_x, ship->shp_y);
- if ((sp->sct_own != ship->shp_own) && (sp->sct_own != 0)) {
- if (getrel(getnatp(sp->sct_own), ship->shp_own) < FRIENDLY)
- return;
- }
+ if (sp->sct_own != 0
+ && sp->sct_own != ship->shp_own
+ && getrel(getnatp(sp->sct_own), ship->shp_own) < FRIENDLY)
+ return;
/* only military can work on a military boat */
if (mp->m_glim != 0)