From d3a3aa4306c7741c2004827d180ab41b8aebaa34 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 17 Feb 2008 08:56:14 +0100 Subject: [PATCH] Don't recompute sct_coastal in desi(), just use it No need to recompute it since sct_coastal was redesigned to be reliable in 4.3.0 (commit 7b947943), --- src/lib/commands/desi.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/lib/commands/desi.c b/src/lib/commands/desi.c index afbd7fcce..637176154 100644 --- a/src/lib/commands/desi.c +++ b/src/lib/commands/desi.c @@ -97,25 +97,13 @@ desi(void) continue; if (sect.sct_type == SCT_SANCT) breaksanct++; - if ((des == SCT_HARBR) || (des == SCT_BHEAD)) { - for (n = 1; n <= 6; n++) { - getsect(nstr.x + diroff[n][0], - nstr.y + diroff[n][1], &check); - if (check.sct_type == SCT_WATER) - break; - if (check.sct_type == SCT_BSPAN) - break; - if (check.sct_type == SCT_BTOWER) - break; - } - if (n > 6) { - pr("%s does not border on water.\n", - xyas(nstr.x, nstr.y, player->cnum)); - if (player->god) - pr("But if it's what you want ...\n"); - else - continue; - } + if ((des == SCT_HARBR || des == SCT_BHEAD) && !sect.sct_coastal) { + pr("%s does not border on water.\n", + xyas(nstr.x, nstr.y, player->cnum)); + if (player->god) + pr("But if it's what you want ...\n"); + else + continue; } if (sect.sct_type == SCT_SANCT && !player->god) continue; -- 2.43.0