From 8d32f375888c66ebec517330b633917dde4bd2f1 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Mon, 17 Oct 2016 17:31:00 +0100 Subject: [PATCH] Make the Elbereth restrictions more flavour-consistent Elbereth now has to be on a square by itself; it's hard to justify why text before it would prevent it working if text after it fails to prevent it working. --- src/engrave.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engrave.c b/src/engrave.c index 0c2670af2..04921ca2a 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -257,8 +257,7 @@ xchar x, y; * Ignore headstones, in case the player names herself "Elbereth". * * If strict checking is requested, the word is only considered to be - * present if it is intact and is the first word in the engraving. - * ("Elbereth burrito" matches; "o Elbereth" does not.) + * present if it is intact and is the entire content of the engraving. */ int sengr_at(s, x, y, strict) @@ -269,7 +268,7 @@ boolean strict; register struct engr *ep = engr_at(x, y); if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= moves) { - return strict ? (strncmpi(ep->engr_txt, s, strlen(s)) == 0) + return strict ? (fuzzymatch(ep->engr_txt, s, "", TRUE)) : (strstri(ep->engr_txt, s) != 0); } return FALSE; -- 2.40.0