summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/spl-util.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 5d7997d7c5..d3bca7ef8a 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -121,7 +121,12 @@ spell_type spell_by_name(std::string name, bool partial_match)
const std::string spell_name = lowercase_string(sptitle);
if (spell_name.find(name) != std::string::npos)
+ {
+ if (spell_name == name)
+ return static_cast<spell_type>(i);
+
spellmatch = i;
+ }
}
return (spellmatch != -1? static_cast<spell_type>(spellmatch)