From 73a79a3d492e24d7cc922f791326b66c47c6bc71 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 8 Jun 2008 06:04:37 +0000 Subject: Changed spell_by_name() so that even if partial matches are allowed, exact matches are still prefered over partial matches. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5591 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spl-util.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crawl-ref/source/spl-util.cc') 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(i); + spellmatch = i; + } } return (spellmatch != -1? static_cast(spellmatch) -- cgit v1.2.3-54-g00ecf