diff options
author | Bardur Arantsson <bardur@scientician.net> | 2018-03-25 20:07:30 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2018-03-25 20:07:30 +0200 |
commit | 5034252fa024de1082084a84fde3c925d89a51e0 (patch) | |
tree | b75e385c34dd1abcb3aef8511d76c110ee6fbad9 /src/spells5.cc | |
parent | bfa9713ee6e8299cb6cd26dd291b024191926070 (diff) |
Aggressively signal missing spells as errors
Diffstat (limited to 'src/spells5.cc')
-rw-r--r-- | src/spells5.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/spells5.cc b/src/spells5.cc index ba2e6d05..1ce69914 100644 --- a/src/spells5.cc +++ b/src/spells5.cc @@ -37,7 +37,7 @@ spell_type *spell_at(s32b index) return school_spells[index]; } -int find_spell(cptr name) +boost::optional<int> find_spell(cptr name) { int i; @@ -45,12 +45,11 @@ int find_spell(cptr name) { if (streq(spell_type_name(spell_at(i)), name)) { - return i; + return boost::make_optional(i); } } - /* Not found */ - return -1; + return boost::none; } s16b get_random_spell(s16b random_type, int level) |