summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-08 14:13:17 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-08 14:13:17 -0600
commite4ed21470a29b0f88424ee48a44d166666c36609 (patch)
tree5a16076cf8eb9506293ae15967cd0ffd3b472a5c /crawl-ref/source/mon-util.cc
parentf5c61bd43ba6fc429cc424c0ea9acfd426c77b2c (diff)
downloadcrawl-ref-e4ed21470a29b0f88424ee48a44d166666c36609.tar.gz
crawl-ref-e4ed21470a29b0f88424ee48a44d166666c36609.zip
When mutiplying/dividing by slime creatures' number, check if it's
greayer than 1, to avoid redundant operations.
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 800a1956df..550643fc51 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1070,7 +1070,7 @@ mon_attack_def mons_attack_spec(const monsters *mon, int attk_number)
}
// Slime creature attacks are multiplied by the number merged.
- if (mon->type == MONS_SLIME_CREATURE && mon->number)
+ if (mon->type == MONS_SLIME_CREATURE && mon->number > 1)
attk.damage *= mon->number;
return (zombified ? downscale_zombie_attack(mon, attk) : attk);
@@ -1218,7 +1218,7 @@ int exper_value(const monsters *monster)
// Hacks to make merged slime creatures not worth so much exp. We
// will calculate the experience we would get for 1 blob, and then
// just multiply it so that exp is linear with blobs merged. -cao
- if (monster->type == MONS_SLIME_CREATURE && monster->number)
+ if (monster->type == MONS_SLIME_CREATURE && monster->number > 1)
maxhp /= monster->number;
// These are some values we care about.
@@ -1336,7 +1336,7 @@ int exper_value(const monsters *monster)
// Slime creature exp hack part 2: Scale exp back up by the number
// of blobs merged. -cao
- if (monster->type == MONS_SLIME_CREATURE && monster->number)
+ if (monster->type == MONS_SLIME_CREATURE && monster->number > 1)
x_val *= monster->number;
// Reductions for big values. - bwr