summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-09-29 10:17:05 -0500
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-09-29 10:17:05 -0500
commit7f72c37783571cc8a398b0c9d56a2727191c08c4 (patch)
tree4699b222006d112b81f3c2c43d09cd4908167d8a /crawl-ref/source/fight.cc
parent75f92afc22ec70a6753551d71ecc731712e9e53c (diff)
downloadcrawl-ref-7f72c37783571cc8a398b0c9d56a2727191c08c4.tar.gz
crawl-ref-7f72c37783571cc8a398b0c9d56a2727191c08c4.zip
Simplify several random array selections by using RANDOM_ELEMENT().
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 12ab335741..6497ac8fe5 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -4282,12 +4282,9 @@ static const char *klown_attack[] =
std::string melee_attack::mons_attack_verb(const mon_attack_def &attk)
{
if (attacker->id() == MONS_KILLER_KLOWN && attk.type == AT_HIT)
- {
- const int num_attacks = sizeof(klown_attack) / sizeof(*klown_attack);
- return (klown_attack[random2(num_attacks)]);
- }
+ return (RANDOM_ELEMENT(klown_attack));
- if (attacker->id() == MONS_KRAKEN_TENTACLE)
+ if (attacker->id() == MONS_KRAKEN_TENTACLE && attk.type == AT_TENTACLE_SLAP)
return ("slap");
static const char *attack_types[] =