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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user