mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 13:53:51 +00:00
Use the correct skill for creature AI weapon hit chance rating
This commit is contained in:
parent
7f3769d5fc
commit
74229490e4
1 changed files with 12 additions and 4 deletions
|
@ -108,11 +108,19 @@ namespace MWMechanics
|
|||
}
|
||||
}
|
||||
|
||||
int skill = item.getClass().getEquipmentSkill(item);
|
||||
if (skill != -1)
|
||||
if (actor.getClass().isNpc())
|
||||
{
|
||||
int value = actor.getClass().getSkill(actor, skill);
|
||||
rating *= MWMechanics::getHitChance(actor, enemy, value) / 100.f;
|
||||
int skill = item.getClass().getEquipmentSkill(item);
|
||||
if (skill != -1)
|
||||
{
|
||||
int value = actor.getClass().getSkill(actor, skill);
|
||||
rating *= MWMechanics::getHitChance(actor, enemy, value) / 100.f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref = actor.get<ESM::Creature>();
|
||||
rating *= MWMechanics::getHitChance(actor, enemy, ref->mBase->mData.mCombat) / 100.f;
|
||||
}
|
||||
|
||||
return rating * rangedMult;
|
||||
|
|
Loading…
Reference in a new issue