forked from github/server
Merge branch 'master' of github.com:eressea/server
This commit is contained in:
commit
44024878f9
|
@ -330,8 +330,9 @@ static void test_magic_resistance(CuTest *tc)
|
||||||
CuAssertDblEquals_Msg(tc, "race reduction", 0.4, magres, 0.01);
|
CuAssertDblEquals_Msg(tc, "race reduction", 0.4, magres, 0.01);
|
||||||
|
|
||||||
rc->magres = 1.5; /* should not cause negative damage multiplier */
|
rc->magres = 1.5; /* should not cause negative damage multiplier */
|
||||||
|
CuAssertDblEquals_Msg(tc, "magic resistance is never > 0.9", 0.9, magic_resistance(du), 0.01);
|
||||||
calculate_armor(dt, 0, 0, &magres);
|
calculate_armor(dt, 0, 0, &magres);
|
||||||
CuAssertDblEquals_Msg(tc, "damage reduction is never < 0", 0.0, magres, 0.01);
|
CuAssertDblEquals_Msg(tc, "damage reduction is never < 0.1", 0.1, magres, 0.01);
|
||||||
|
|
||||||
free_battle(b);
|
free_battle(b);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
|
|
|
@ -1177,7 +1177,8 @@ double magic_resistance(unit * target)
|
||||||
if (btype)
|
if (btype)
|
||||||
probability += btype->magresbonus * 0.01;
|
probability += btype->magresbonus * 0.01;
|
||||||
}
|
}
|
||||||
return probability;
|
|
||||||
|
return (probability<0.9) ? probability : 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
Loading…
Reference in New Issue