1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-05 22:19:43 +00:00

Slight cleanup

This commit is contained in:
Capostrophic 2018-08-31 01:54:59 +03:00
parent 533b72eff6
commit fa3e45fa7d

View file

@ -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;
} }