diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-05-28 07:55:57 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-05-29 21:43:56 +0200 |
commit | 77fcd7e02c87167002b8294a47c6cc37a0c960b3 (patch) | |
tree | 46d377f3994b514778162060f514d73359a942bb /src/cmd6.c | |
parent | f2b27a7ab74529504da68d418fdcecabd5ee989a (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.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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); } } |