From 6c893f5cc36ce9b051e25a64c798a78c14db58d3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 30 Jan 2011 16:31:02 +0100 Subject: [PATCH] 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. --- src/lib/subs/lndsub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) { -- 2.43.0