summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-07 12:37:19 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-07 12:37:19 +0000
commitfa0e36a06cd154cc1d529dd7645ae47fab8af000 (patch)
tree0443c217f381944a95650df9aa3cbc4b8004879b
parent80efbb31cad981ef99a5526b895a040fb930d46a (diff)
downloadcrawl-ref-fa0e36a06cd154cc1d529dd7645ae47fab8af000.tar.gz
crawl-ref-fa0e36a06cd154cc1d529dd7645ae47fab8af000.zip
Zappiness type safety.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1412 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc6
-rw-r--r--crawl-ref/source/beam.h2
-rw-r--r--crawl-ref/source/it_use3.cc7
-rw-r--r--crawl-ref/source/item_use.cc3
4 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 32d73c56bc..0f3c8b94af 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -91,7 +91,7 @@ static void explosion_map(struct bolt &beam, int x, int y,
static void explosion_cell(struct bolt &beam, int x, int y, bool drawOnly);
static void ench_animation( int flavour, const monsters *mon = NULL, bool force = false);
-static void zappy(char z_type, int power, struct bolt &pbolt);
+static void zappy(zap_type z_type, int power, struct bolt &pbolt);
static void monster_die(monsters *mons, const bolt &beam);
static std::set<std::string> beam_message_cache;
@@ -196,7 +196,7 @@ static void ench_animation( int flavour, const monsters *mon, bool force )
zap_animation( element_colour( elem ), mon, force );
}
-void zapping(char ztype, int power, struct bolt &pbolt)
+void zapping(zap_type ztype, int power, struct bolt &pbolt)
{
#if DEBUG_DIAGNOSTICS
@@ -263,7 +263,7 @@ dice_def calc_dice( int num_dice, int max_damage )
// *do not* call this function directly (duh - it's static), need to
// see zapping() for default values not set within this function {dlb}
-static void zappy( char z_type, int power, struct bolt &pbolt )
+static void zappy( zap_type z_type, int power, struct bolt &pbolt )
{
int temp_rand = 0; // probability determination {dlb}
diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h
index 42848c9465..3ff7792e47 100644
--- a/crawl-ref/source/beam.h
+++ b/crawl-ref/source/beam.h
@@ -94,7 +94,7 @@ bool check_line_of_sight( int sx, int sy, int tx, int ty );
void mimic_alert( struct monsters *mimic );
-void zapping( char ztype, int power, struct bolt &pbolt );
+void zapping( zap_type ztype, int power, struct bolt &pbolt );
int affect(struct bolt &beam, int x, int y);
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc
index 3b936bedda..c0f47d3103 100644
--- a/crawl-ref/source/it_use3.cc
+++ b/crawl-ref/source/it_use3.cc
@@ -762,7 +762,6 @@ static bool disc_of_storms(void)
{
int temp_rand = 0; // probability determination {dlb}
int disc_count = 0;
- unsigned char which_zap = 0;
const int fail_rate = (30 - you.skills[SK_EVOCATIONS]);
bool ret = false;
@@ -785,9 +784,9 @@ static bool disc_of_storms(void)
temp_rand = random2(3);
- which_zap = ((temp_rand > 1) ? ZAP_LIGHTNING :
- (temp_rand > 0) ? ZAP_ELECTRICITY
- : ZAP_ORB_OF_ELECTRICITY);
+ zap_type which_zap = ((temp_rand > 1) ? ZAP_LIGHTNING :
+ (temp_rand > 0) ? ZAP_ELECTRICITY
+ : ZAP_ORB_OF_ELECTRICITY);
beam.source_x = you.x_pos;
beam.source_y = you.y_pos;
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 7c268236a8..aa84c83c77 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2599,7 +2599,8 @@ void zap_wand(void)
beam.source_y = you.y_pos;
beam.set_target(zap_wand);
- zapping( type_zapped, 30 + roll_dice(2, you.skills[SK_EVOCATIONS]), beam );
+ zapping( static_cast<zap_type>(type_zapped),
+ 30 + roll_dice(2, you.skills[SK_EVOCATIONS]), beam );
if (beam.obvious_effect == 1 || you.inv[item_slot].sub_type == WAND_FIREBALL)
{