forked from github/server
remove the rules.hunger.reduces_skill variable, no game was doing anything other than the default.
This commit is contained in:
parent
0a47f0e398
commit
817d81dbf9
|
@ -1323,7 +1323,6 @@ int get_modifier(const unit * u, skill_t sk, int level, const region * r, bool n
|
||||||
{
|
{
|
||||||
int bskill = level;
|
int bskill = level;
|
||||||
int skill = bskill;
|
int skill = bskill;
|
||||||
int hunger_red_skill = -1;
|
|
||||||
|
|
||||||
if (r && sk == SK_STEALTH) {
|
if (r && sk == SK_STEALTH) {
|
||||||
plane *pl = rplane(r);
|
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
|
#endif
|
||||||
skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS);
|
skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS);
|
||||||
|
|
||||||
if (hunger_red_skill == -1) {
|
if (fval(u, UFL_HUNGER)) {
|
||||||
hunger_red_skill = config_get_int("rules.hunger.reduces_skill", 2);
|
if (sk == SK_SAILING && skill > 2) {
|
||||||
}
|
|
||||||
|
|
||||||
if (fval(u, UFL_HUNGER) && hunger_red_skill) {
|
|
||||||
if (sk == SK_SAILING && skill > 2 && hunger_red_skill == 2) {
|
|
||||||
skill = skill - 1;
|
skill = skill - 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -283,16 +283,6 @@ static void test_skill_hunger(CuTest *tc) {
|
||||||
set_level(u, SK_ARMORER, 6);
|
set_level(u, SK_ARMORER, 6);
|
||||||
set_level(u, SK_SAILING, 6);
|
set_level(u, SK_SAILING, 6);
|
||||||
fset(u, UFL_HUNGER);
|
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, 3, effskill(u, SK_ARMORER, 0));
|
||||||
CuAssertIntEquals(tc, 5, effskill(u, SK_SAILING, 0));
|
CuAssertIntEquals(tc, 5, effskill(u, SK_SAILING, 0));
|
||||||
set_level(u, SK_SAILING, 2);
|
set_level(u, SK_SAILING, 2);
|
||||||
|
|
Loading…
Reference in New Issue