initial pass for toning down Elbereth

This commit is contained in:
Derek S. Ray
2015-04-23 23:04:35 -04:00
parent 5a87938c7d
commit 22ffe3b84e
3 changed files with 47 additions and 14 deletions

View File

@@ -220,16 +220,24 @@ xchar x, y;
/* Decide whether a particular string is engraved at a specified
* location; a case-insensitive substring match used.
* 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.)
*/
int
sengr_at(s, x, y)
sengr_at(s, x, y, strict)
const char *s;
xchar x, y;
boolean strict;
{
register struct engr *ep = engr_at(x,y);
return (ep && ep->engr_type != HEADSTONE &&
ep->engr_time <= moves && strstri(ep->engr_txt, s) != 0);
if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= moves) {
return strict ? (strncmpi(ep->engr_txt, s, strlen(s)) == 0) :
(strstri(ep->engr_txt, s) != 0);
}
return FALSE;
}
void