mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-05 22:19:43 +00:00
Slight cleanup
This commit is contained in:
parent
533b72eff6
commit
fa3e45fa7d
1 changed files with 5 additions and 5 deletions
|
@ -100,21 +100,21 @@ namespace MWMechanics
|
||||||
if (weapon->mData.mType <= ESM::Weapon::MarksmanThrown)
|
if (weapon->mData.mType <= ESM::Weapon::MarksmanThrown)
|
||||||
rating *= weapon->mData.mSpeed;
|
rating *= weapon->mData.mSpeed;
|
||||||
|
|
||||||
|
int value = 50.f;
|
||||||
if (actor.getClass().isNpc())
|
if (actor.getClass().isNpc())
|
||||||
{
|
{
|
||||||
int skill = item.getClass().getEquipmentSkill(item);
|
int skill = item.getClass().getEquipmentSkill(item);
|
||||||
if (skill != -1)
|
if (skill != -1)
|
||||||
{
|
value = actor.getClass().getSkill(actor, skill);
|
||||||
int value = actor.getClass().getSkill(actor, skill);
|
|
||||||
rating *= getHitChance(actor, enemy, value) / 100.f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWWorld::LiveCellRef<ESM::Creature> *ref = actor.get<ESM::Creature>();
|
MWWorld::LiveCellRef<ESM::Creature> *ref = actor.get<ESM::Creature>();
|
||||||
rating *= getHitChance(actor, enemy, ref->mBase->mData.mCombat) / 100.f;
|
value = ref->mBase->mData.mCombat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rating *= getHitChance(actor, enemy, value) / 100.f;
|
||||||
|
|
||||||
return rating * rangedMult;
|
return rating * rangedMult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue