forked from teamnwah/openmw-tes3coop
Combat AI: take the actual hit chance in account when rating weapon
This commit is contained in:
parent
1c13256456
commit
382b68a081
1 changed files with 4 additions and 1 deletions
|
@ -103,7 +103,10 @@ namespace MWMechanics
|
||||||
|
|
||||||
int skill = item.getClass().getEquipmentSkill(item);
|
int skill = item.getClass().getEquipmentSkill(item);
|
||||||
if (skill != -1)
|
if (skill != -1)
|
||||||
rating *= actor.getClass().getSkill(actor, skill) / 100.f;
|
{
|
||||||
|
MWMechanics::SkillValue& value = actor.getClass().getSkill(actor, skill);
|
||||||
|
rating *= MWMechanics::getHitChance(actor, enemy, value) / 100.f;
|
||||||
|
}
|
||||||
|
|
||||||
// There is no need to apply bonus if weapon rating == 0
|
// There is no need to apply bonus if weapon rating == 0
|
||||||
if (rating == 0.f)
|
if (rating == 0.f)
|
||||||
|
|
Loading…
Reference in a new issue