diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-05-30 05:33:44 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-05-30 20:08:05 +0200 |
commit | 1b9ce2b53e26ed2d983efb9da10eb2be89d6d705 (patch) | |
tree | 1e1a6071fdf11515bf9f3e98fc83b7117045a241 /src/spells5.c | |
parent | fbc40366c8a50a695fcb913c5f25d717330e9672 (diff) |
Lua: Migrate spell schools to C
Diffstat (limited to 'src/spells5.c')
-rw-r--r-- | src/spells5.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/spells5.c b/src/spells5.c index 821d4151..d2d9eda2 100644 --- a/src/spells5.c +++ b/src/spells5.c @@ -90,9 +90,10 @@ s16b get_random_spell(s16b random_type, int level) return -1; } -bool_ check_spell_depends(s16b spell_idx) +bool_ check_spell_depends(spell_type *spell) { - spell_type *spell = spell_at(spell_idx); + assert(spell != NULL); + if (spell->depend_func != NULL) { return spell->depend_func(); } else { @@ -100,34 +101,6 @@ bool_ check_spell_depends(s16b spell_idx) } } -int spell_get_school_idx(s16b spell_idx, int idx) -{ - spell_type *spell = spell_at(spell_idx); - school_idx *school_idx = NULL; - struct sglib_school_idx_iterator sit; - - if (idx < 0) - { - return -1; - } - - for (school_idx = sglib_school_idx_it_init(&sit, spell->schools); - school_idx != NULL && idx > 0; - school_idx = sglib_school_idx_it_next(&sit)) - { - /* Just counting down */ - } - - if (school_idx == NULL) - { - return -1; - } - else - { - return school_idx->i; - } -} - static void spell_init_music(spell_type *spell, s16b minimum_pval) { assert(spell != NULL); |