diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-15 18:05:27 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-15 18:05:27 +0000 |
commit | f7e71c953f4570fba5638a16639e4bf63b5386bb (patch) | |
tree | 2ebccd3bb1da6119865687c2a7eca57946a12ca3 /crawl-ref | |
parent | 17031358b36fa9c1e34b7edcc73fecaeeb06a22d (diff) | |
download | crawl-ref-f7e71c953f4570fba5638a16639e4bf63b5386bb.tar.gz crawl-ref-f7e71c953f4570fba5638a16639e4bf63b5386bb.zip |
Add more miscellaneous minor cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5852 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/effects.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 5 |
2 files changed, 8 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 8432747e97..77db836546 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -2674,15 +2674,14 @@ void handle_time(long time_delta) if (you.special_wield == SPWLD_SHADOW) return; - if (you.equip[EQ_BODY_ARMOUR] != -1 - && random2( item_mass( you.inv[you.equip[EQ_BODY_ARMOUR]] )) >= 100) + // diminishing returns for stealth training by waiting + if ((you.equip[EQ_BODY_ARMOUR] == -1 + || you.equip[EQ_BODY_ARMOUR] != -1 + && random2(item_mass(you.inv[you.equip[EQ_BODY_ARMOUR]])) < 100) + && you.skills[SK_STEALTH] <= 2 + random2(3) && one_chance_in(18)) { - return; + exercise(SK_STEALTH, 1); } - - // diminishing returns for Stealth training by waiting - if (you.skills[SK_STEALTH] <= 2 + random2(3) && one_chance_in(18)) - exercise(SK_STEALTH, 1); } } diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 51a66351bb..ddf66e78d1 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3646,11 +3646,10 @@ int check_stealth(void) if (you.duration[DUR_SILENCE]) stealth -= 50; - if (stealth < 0) - stealth = 0; + stealth = std::max(0, stealth); return (stealth); -} // end check_stealth() +} static void _attribute_increase() { |