diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-10-26 05:14:23 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-10-26 05:20:22 +0200 |
commit | 131d11a7c2c1612c940db100003a09c8e10e4d2d (patch) | |
tree | c92f9e0a0d810bddb60989d15cbad43bac710ede /crawl-ref/source/zotdef.cc | |
parent | 6b76d9282724e7826dd3e732b58ab3c57fcda26c (diff) | |
download | crawl-ref-131d11a7c2c1612c940db100003a09c8e10e4d2d.tar.gz crawl-ref-131d11a7c2c1612c940db100003a09c8e10e4d2d.zip |
Rewrite (x*y)/z as x*y/z
Also, simplify an expression such removal of parentheses revealed.
Diffstat (limited to 'crawl-ref/source/zotdef.cc')
-rw-r--r-- | crawl-ref/source/zotdef.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/zotdef.cc b/crawl-ref/source/zotdef.cc index decd8defb2..bdafd3f2a2 100644 --- a/crawl-ref/source/zotdef.cc +++ b/crawl-ref/source/zotdef.cc @@ -169,9 +169,9 @@ static void _zotdef_fill_from_list(monster_type mlist[], int chance, int power) while (env.mons_alloc[i] == MONS_PROGRAM_BUG) { monster_type mon_type = mlist[random2(ls)]; - if (random2((power * 3) / 2) > _mon_strength(mon_type)) + if (random2(power * 3 / 2) > _mon_strength(mon_type)) continue; // bias away from weaker critters - if (random2((power * 3) / 2) > _mon_strength(mon_type)) + if (random2(power * 3 / 2) > _mon_strength(mon_type)) env.mons_alloc[i] = mon_type; if (one_chance_in(100)) env.mons_alloc[i] = mon_type; // occasional random pick @@ -587,7 +587,7 @@ static monster_type _get_zotdef_monster(level_id &place, int power) // get default level int lev_mons = (place.branch == NUM_BRANCHES) - ? ((strength * 3) / 2) + ? strength * 3 / 2 : mons_depth(mon_type, place.branch) + absdungeon_depth(place.branch, 0); |