summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-15 10:47:28 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-15 11:01:58 -0600
commit022f59dd19d3fca0debba22cf4044453c67672ce (patch)
treeabda0d02c4948a3fd8184b867ed6270d401bcd54 /crawl-ref/source/spells2.cc
parenta4a5504e50ca6e67477de99eba44c62ab4557ca5 (diff)
downloadcrawl-ref-022f59dd19d3fca0debba22cf4044453c67672ce.tar.gz
crawl-ref-022f59dd19d3fca0debba22cf4044453c67672ce.zip
Make brand_ammo() return bool, indicating whether it succeeded.
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index b29ad1bcaa..4fde90899e 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -375,7 +375,7 @@ bool brand_weapon(brand_type which_brand, int power)
return (true);
}
-void brand_ammo(special_missile_type which_type)
+bool brand_ammo(special_missile_type which_type)
{
const int ammo = you.equip[EQ_WEAPON];
@@ -385,9 +385,10 @@ void brand_ammo(special_missile_type which_type)
|| you.inv[ammo].sub_type == MI_THROWING_NET)
{
canned_msg(MSG_NOTHING_HAPPENS);
- return;
+ return (false);
}
+ bool retval = false;
preserve_quiver_slots q;
const char *old_desc = you.inv[ammo].name(DESC_CAP_YOUR).c_str();
@@ -401,6 +402,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -414,6 +417,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -427,6 +432,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -440,6 +447,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -453,6 +462,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -466,6 +477,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -479,6 +492,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -492,6 +507,8 @@ void brand_ammo(special_missile_type which_type)
if (ammo == you.equip[EQ_WEAPON])
you.wield_change = true;
+
+ retval = true;
}
else
canned_msg(MSG_NOTHING_HAPPENS);
@@ -501,6 +518,8 @@ void brand_ammo(special_missile_type which_type)
canned_msg(MSG_NOTHING_HAPPENS);
break;
}
+
+ return (retval);
}
// Restore the stat in which_stat by the amount in stat_gain, displaying