From: Markus Armbruster Date: Sun, 30 Jan 2011 15:31:02 +0000 (+0100) Subject: Use relations_with() in lnd_mar_one_sector() X-Git-Tag: v4.3.27~132 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=6c893f5cc36ce9b051e25a64c798a78c14db58d3 Use relations_with() in lnd_mar_one_sector() No functional change, because the value of rel only matters when sect.sct_own != actor, and then it's the same as before. The new value of rel permits simplifying sect.sct_own != actor && rel != ALLIED to just rel != ALLIED. --- diff --git a/src/lib/subs/lndsub.c b/src/lib/subs/lndsub.c index c6bc43360..fe0690124 100644 --- a/src/lib/subs/lndsub.c +++ b/src/lib/subs/lndsub.c @@ -933,8 +933,8 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor, newx = xnorm(llp->unit.land.lnd_x + dx); newy = ynorm(llp->unit.land.lnd_y + dy); getsect(newx, newy, §); - rel = getrel(getnatp(sect.sct_own), actor); - if ((sect.sct_own != actor && rel != ALLIED && + rel = relations_with(sect.sct_own, actor); + if ((rel != ALLIED && !(lchr[(int)llp->unit.land.lnd_type].l_flags & L_SPY) && sect.sct_own) || (sect.sct_type == SCT_WATER || sect.sct_type == SCT_SANCT || @@ -999,7 +999,7 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor, mpr(actor, "You no longer own %s\n", xyas(osect.sct_x, osect.sct_y, actor)); } - if (rel != ALLIED && sect.sct_own != actor && sect.sct_own) { /* must be a spy */ + if (rel != ALLIED && sect.sct_own) { /* must be a spy */ /* Always a 10% chance of getting caught. */ if (chance(LND_SPY_DETECT_CHANCE(llp->unit.land.lnd_effic))) { if (rel == NEUTRAL || rel == FRIENDLY) {