sengr_at() schizophrenia

sengr_at() is used as a boolean, declared as int, and returns FALSE
if there is no engraving present.  Change the declaration to boolean.

Also, using fuzzymatch() without any list of ignorable characters
just to get case-insensitve matching didn't make sense so switch to
strcmpi().
This commit is contained in:
PatR
2022-04-01 05:22:20 -07:00
parent f0c7394968
commit 575b76afc3
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -268,16 +268,15 @@ engr_at(xchar x, xchar y)
* If strict checking is requested, the word is only considered to be
* present if it is intact and is the entire content of the engraving.
*/
int
boolean
sengr_at(const char *s, xchar x, xchar y, boolean strict)
{
register struct engr *ep = engr_at(x, y);
if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= g.moves) {
return strict ? (fuzzymatch(ep->engr_txt, s, "", TRUE))
: (strstri(ep->engr_txt, s) != 0);
return (strict ? !strcmpi(ep->engr_txt, s)
: (strstri(ep->engr_txt, s) != 0));
}
return FALSE;
}