From b49b73d9b3736c7dad367e7f61c78ca35787f428 Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 8 Jul 2007 01:00:51 +0000 Subject: Lots and lots of type safety. Caught a bug in the definition of shadows (isn't it lucky that BLACK == MST_NO_SPELLS?) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1788 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spl-util.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/spl-util.cc') diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index ed62c89478..6cd0a5cad2 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -674,8 +674,10 @@ void apply_area_cloud( int (*func) (int, int, int, cloud_type, kill_category), } } // end apply_area_cloud() -char spell_direction( struct dist &spelld, struct bolt &pbolt, - targeting_type restrict, int mode, +// Select a spell direction and fill dist and pbolt appropriately. +// Return false if the user canceled, true otherwise. +bool spell_direction( dist &spelld, bolt &pbolt, + targeting_type restrict, targ_mode_type mode, const char *prompt ) { if (restrict != DIR_DIR) @@ -687,14 +689,14 @@ char spell_direction( struct dist &spelld, struct bolt &pbolt, { // check for user cancel canned_msg(MSG_OK); - return -1; + return false; } pbolt.set_target(spelld); pbolt.source_x = you.x_pos; pbolt.source_y = you.y_pos; - return 1; + return true; } // end spell_direction() const char* spelltype_short_name( int which_spelltype ) -- cgit v1.2.3-54-g00ecf