From: nethack.rankin Date: Sun, 2 Oct 2011 02:18:54 +0000 (+0000) Subject: hobbit tidbit (trunk only) X-Git-Tag: MOVE2GIT~171 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5224ab2d08207c5443bf66bfbd925e4b5097054;p=nethack hobbit tidbit (trunk only) While testing the need-hands-to-open-tins patch, I tried to polyself into a halfling and failed. Add it to the monster name lookup routine as a variant spelling for hobbit. --- diff --git a/src/mondata.c b/src/mondata.c index e4203297c..029c00d9c 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -621,6 +621,8 @@ const char *in_str; { "master of assassin", PM_MASTER_ASSASSIN }, /* Outdated names */ { "invisible stalker", PM_STALKER }, + { "high-elf", PM_ELVENKING }, /* PM_HIGH_ELF is obsolete */ + { "halfling", PM_HOBBIT }, /* potential guess for polyself */ /* Hyphenated names */ { "ki rin", PM_KI_RIN }, { "uruk hai", PM_URUK_HAI }, @@ -630,9 +632,6 @@ const char *in_str; { "grey elf", PM_GREY_ELF }, { "gray elf", PM_GREY_ELF }, { "elf lord", PM_ELF_LORD }, -#if 0 /* OBSOLETE */ - { "high elf", PM_HIGH_ELF }, -#endif { "olog hai", PM_OLOG_HAI }, { "arch lich", PM_ARCH_LICH }, /* Some irregular plurals */ @@ -660,8 +659,9 @@ const char *in_str; for (len = 0, i = LOW_PM; i < NUMMONS; i++) { register int m_i_len = strlen(mons[i].mname); if (m_i_len > len && !strncmpi(mons[i].mname, str, m_i_len)) { - if (m_i_len == slen) return i; /* exact match */ - else if (slen > m_i_len && + if (m_i_len == slen) { + return i; /* exact match */ + } else if (slen > m_i_len && (str[m_i_len] == ' ' || !strcmpi(&str[m_i_len], "s") || !strncmpi(&str[m_i_len], "s ", 2) ||