summaryrefslogtreecommitdiff
path: root/src/cmd6.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-05-28 07:55:57 +0200
committerBardur Arantsson <bardur@scientician.net>2012-05-29 21:43:56 +0200
commit77fcd7e02c87167002b8294a47c6cc37a0c960b3 (patch)
tree46d377f3994b514778162060f514d73359a942bb /src/cmd6.c
parentf2b27a7ab74529504da68d418fdcecabd5ee989a (diff)
Lua: Reintroduce the "obvious" flag from casting
This got accidentally removed when moving the spell functions to C.
Diffstat (limited to 'src/cmd6.c')
-rw-r--r--src/cmd6.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/cmd6.c b/src/cmd6.c
index 7bd6c80a..32ad1868 100644
--- a/src/cmd6.c
+++ b/src/cmd6.c
@@ -3655,7 +3655,7 @@ void unset_stick_mode()
static void activate_stick(s16b s, bool_ *obvious, bool_ *use_charge)
{
spell_type *spell = spell_at(s);
- bool_ *ret;
+ casting_result ret;
assert(obvious != NULL);
assert(use_charge != NULL);
@@ -3663,15 +3663,22 @@ static void activate_stick(s16b s, bool_ *obvious, bool_ *use_charge)
ret = spell->effect_func(-1);
- if (ret == NULL)
+ switch (ret)
{
+ case NO_CAST:
*use_charge = FALSE;
*obvious = FALSE;
- }
- else
- {
+ break;
+ case CAST_HIDDEN:
*use_charge = TRUE;
- *obvious = *ret;
+ *obvious = FALSE;
+ break;
+ case CAST_OBVIOUS:
+ *use_charge = TRUE;
+ *obvious = TRUE;
+ break;
+ default:
+ assert(FALSE);
}
}