mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-04 03:49:48 +00:00
Merge pull request #1878 from Capostrophic/hitchance
Use the correct skill for creature AI weapon hit chance rating
This commit is contained in:
commit
b748bb11ae
1 changed files with 12 additions and 4 deletions
|
@ -108,12 +108,20 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (actor.getClass().isNpc())
|
||||||
|
{
|
||||||
int skill = item.getClass().getEquipmentSkill(item);
|
int skill = item.getClass().getEquipmentSkill(item);
|
||||||
if (skill != -1)
|
if (skill != -1)
|
||||||
{
|
{
|
||||||
int value = actor.getClass().getSkill(actor, skill);
|
int value = actor.getClass().getSkill(actor, skill);
|
||||||
rating *= MWMechanics::getHitChance(actor, enemy, value) / 100.f;
|
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;
|
return rating * rangedMult;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue