diff options
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r-- | crawl-ref/source/spl-util.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 7f6adfe75d..abf3ebabc6 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -114,10 +114,10 @@ spell_type spell_by_name(std::string name, bool partial_match) for (int i = 0; i < NUM_SPELLS; i++) { spell_type type = static_cast<spell_type>(i); - const char *sptitle = spell_title(type); - if (!sptitle) + if (!is_valid_spell(type)) continue; - + + const char *sptitle = spell_title(type); const std::string spell_name = lowercase_string(sptitle); if (spell_name.find(name) != std::string::npos) |