diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-04 06:49:36 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-04 06:49:36 +0000 |
commit | c9b7d443bf6acf3514a6374a3f84200aee48959b (patch) | |
tree | 47cede2c73966337179c1b44ae25075c25f78e49 | |
parent | ab95ccbc8f5e57b8a615fdaaae2fef383e6aecc7 (diff) | |
download | crawl-ref-c9b7d443bf6acf3514a6374a3f84200aee48959b.tar.gz crawl-ref-c9b7d443bf6acf3514a6374a3f84200aee48959b.zip |
Type safety on SPRET results.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1210 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.h | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 5c7a18bb2a..1ca538d0cf 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -668,7 +668,7 @@ bool cast_a_spell(void) random_uselessness( 2 + random2(7), 0 ); else { - const int cast_result = your_spells( spell ); + const spret_type cast_result = your_spells( spell ); if (cast_result == SPRET_ABORT) return (false); @@ -852,7 +852,7 @@ static bool spell_is_uncastable(int spell) // returns SPRET_SUCCESS if spell is successfully cast for purposes of // exercising, SPRET_FAIL otherwise, or SPRET_ABORT if the player canceled // the casting. -int your_spells( int spc2, int powc, bool allow_fail ) +spret_type your_spells( int spc2, int powc, bool allow_fail ) { int dem_hor = 0; int dem_hor2 = 0; diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h index 30f5a49c2e..04557a95d7 100644 --- a/crawl-ref/source/spl-cast.h +++ b/crawl-ref/source/spl-cast.h @@ -14,6 +14,8 @@ #ifndef SPL_CAST_H #define SPL_CAST_H +#include "enum.h" + char list_spells( void ); int spell_fail( int spell ); int calc_spell_power( int spell, bool apply_intel, bool fail_rate_chk = false ); @@ -37,7 +39,7 @@ bool cast_a_spell( void ); /* *********************************************************************** * called from: ability - debug - it_use3 - spell * *********************************************************************** */ -int your_spells( int spc2, int powc = 0, bool allow_fail = true ); +spret_type your_spells( int spc2, int powc = 0, bool allow_fail = true ); // last updated 12may2000 {dlb} /* *********************************************************************** |