fix github issue #722 - unique monster's corpse
Issue #722 posted by copperwater and commented on by Entrez: both shk_your() and the() inserted "the" in front of a unique monster's corpse, yielding "the Lord Surtur's corpse glows iridescently" and "the Lord Surtur's corpse drops to the floor." Teach both of those routines to skip "the" when used for monsters with personal names. It now omits "the" for "Medusa's corpse" but still gives "the Oracle's corpse". shk_your() operates on an object and can deal explicitly with corpses of named monsters. the() operates on text and has to guess whether it is being used in a similar situation. Right now the guess is just "is there an apostrophe present?" and might need further refinement. Fixes #722
This commit is contained in:
+4
-3
@@ -792,10 +792,11 @@ CapitalMon(
|
||||
/*
|
||||
* Unlike name_to_mon(), we don't need to find the longest match
|
||||
* or return the gender or a pointer to trailing stuff. We do
|
||||
* check full words though: "Foo" matches "Foo" and "Foo bar" but
|
||||
* not "Foobar". We use case-sensitive matching here.
|
||||
* check full words though: "Foo" matches "Foo" and "Foo bar" and
|
||||
* "Foo's bar" but not "Foobar". We use case-sensitive matching.
|
||||
*/
|
||||
if (!strncmp(nam, word, nln) && (!word[nln] || word[nln] == ' '))
|
||||
if (!strncmp(nam, word, nln)
|
||||
&& (!word[nln] || word[nln] == ' ' || word[nln] == '\''))
|
||||
return TRUE; /* 'word' is a capitalized monster name */
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user