summaryrefslogtreecommitdiff
path: root/src/spells4.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
commit0b74fd491aeda33e25a20986f40f6c461fb20f06 (patch)
tree6f1329635676b6bf995a71ba3c15a4d9f4aa42d3 /src/spells4.cc
parent528a95aaef400b264203d3e8621887ea0307e9ea (diff)
Split spell_chance into device and book variants
The code calling spell_chance() always actually knows which kind of spell its looking at, so we might as well exploit that.
Diffstat (limited to 'src/spells4.cc')
-rw-r--r--src/spells4.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/spells4.cc b/src/spells4.cc
index 31811449..76ea4400 100644
--- a/src/spells4.cc
+++ b/src/spells4.cc
@@ -2,6 +2,7 @@
#include <assert.h>
+#include "lua_bind.hpp"
#include "spell_type.h"
#include "spell_type.hpp"
#include "spell_idx_list.hpp"
@@ -445,7 +446,7 @@ int print_spell(cptr label_, byte color, int y, s32b s)
sch_str,
level_str,
get_mana(s),
- (int) spell_chance(s),
+ (int) spell_chance_book(s),
spell_info);
c_prt(color, buf, y, 0);
@@ -539,7 +540,7 @@ void lua_cast_school_spell(s32b s, bool_ no_cost)
}
/* Invoke the spell effect */
- if (!magik(spell_chance(s)))
+ if (!magik(spell_chance_book(s)))
{
use = (spell_type_produce_effect(spell, -1) != NO_CAST);
}