Combat AI: take the actual hit chance in account when rating weapon

pull/469/head
Capostrophic 7 years ago committed by GitHub
parent 1c13256456
commit 382b68a081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save