1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-29 22:20:33 +00:00

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

This commit is contained in:
Capostrophic 2018-08-01 19:27:19 +03:00 committed by GitHub
parent 1c13256456
commit 382b68a081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,10 @@ namespace MWMechanics
int skill = item.getClass().getEquipmentSkill(item);
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
if (rating == 0.f)