diff options
-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() { |