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

View File

@@ -778,7 +778,7 @@ extern void cant_reach_floor(int, int, boolean, boolean);
extern const char *surface(int, int);
extern const char *ceiling(int, int);
extern struct engr *engr_at(xchar, xchar);
extern int sengr_at(const char *, xchar, xchar, boolean);
extern boolean sengr_at(const char *, xchar, xchar, boolean);
extern void u_wipe_engr(int);
extern void wipe_engr_at(xchar, xchar, xchar, boolean);
extern void read_engr_at(int, int);

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;
}