summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/player.cc8
-rw-r--r--crawl-ref/source/stuff.cc10
2 files changed, 3 insertions, 15 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index aa5098b3ff..598aa55dc0 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2215,12 +2215,8 @@ void forget_map(unsigned char chance_forgotten)
void gain_exp( unsigned int exp_gained )
{
-
- if (player_equip_ego_type( EQ_BODY_ARMOUR, SPARM_ARCHMAGI )
- && !one_chance_in(20))
- {
- return;
- }
+ if (player_equip_ego_type( EQ_BODY_ARMOUR, SPARM_ARCHMAGI ))
+ exp_gained = div_rand_round( exp_gained, 4 );
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "gain_exp: %d", exp_gained );
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index c40d737fd9..8f31c89f07 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -508,18 +508,10 @@ int div_rand_round( int num, int den )
return (num / den + (random2(den) < num % den));
}
-// I got so tired of seeing: ".. && random2(foo) == 0 && .." in the code
-// that I broke down and wrote this little -- very little -- function.
-// anyway, I think improving the readability of the code offsets whatever
-// overhead the additional (intermediary) function call added to Crawl -
-// we'll just make it up by tightening code elsewhere, right guys?
-// [use with == and != only .. never directly with comparisons or math]
-// -- 14jan2000 {dlb}
bool one_chance_in(int a_million)
{
return (random2(a_million) == 0);
-} // end one_chance_in() - that's it? :P {dlb}
-
+}
// simple little function to quickly modify all three stats
// at once - does check for '0' modifiers to prevent needless