remove the rules.hunger.reduces_skill variable, no game was doing anything other than the default.

This commit is contained in:
Enno Rehling 2015-11-23 21:03:36 +01:00
parent 0a47f0e398
commit 817d81dbf9
2 changed files with 2 additions and 17 deletions

View File

@ -1323,7 +1323,6 @@ int get_modifier(const unit * u, skill_t sk, int level, const region * r, bool n
{
int bskill = level;
int skill = bskill;
int hunger_red_skill = -1;
if (r && sk == SK_STEALTH) {
plane *pl = rplane(r);
@ -1342,12 +1341,8 @@ int get_modifier(const unit * u, skill_t sk, int level, const region * r, bool n
#endif
skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS);
if (hunger_red_skill == -1) {
hunger_red_skill = config_get_int("rules.hunger.reduces_skill", 2);
}
if (fval(u, UFL_HUNGER) && hunger_red_skill) {
if (sk == SK_SAILING && skill > 2 && hunger_red_skill == 2) {
if (fval(u, UFL_HUNGER)) {
if (sk == SK_SAILING && skill > 2) {
skill = skill - 1;
}
else {

View File

@ -283,16 +283,6 @@ static void test_skill_hunger(CuTest *tc) {
set_level(u, SK_ARMORER, 6);
set_level(u, SK_SAILING, 6);
fset(u, UFL_HUNGER);
config_set("rules.hunger.reduces_skill", "0");
CuAssertIntEquals(tc, 6, effskill(u, SK_ARMORER, 0));
CuAssertIntEquals(tc, 6, effskill(u, SK_SAILING, 0));
config_set("rules.hunger.reduces_skill", "1");
CuAssertIntEquals(tc, 3, effskill(u, SK_ARMORER, 0));
CuAssertIntEquals(tc, 3, effskill(u, SK_SAILING, 0));
config_set("rules.hunger.reduces_skill", "2");
CuAssertIntEquals(tc, 3, effskill(u, SK_ARMORER, 0));
CuAssertIntEquals(tc, 5, effskill(u, SK_SAILING, 0));
set_level(u, SK_SAILING, 2);