mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Combat AI: normalize hit chance in the weapon priority calculation
This commit is contained in:
parent
5f0c8a4783
commit
2a08b85998
@ -127,7 +127,9 @@ namespace MWMechanics
|
|||||||
value = ref->mBase->mData.mCombat;
|
value = ref->mBase->mData.mCombat;
|
||||||
}
|
}
|
||||||
|
|
||||||
rating *= getHitChance(actor, enemy, value) / 100.f;
|
// Take hit chance in account, but do not allow rating become negative.
|
||||||
|
float chance = getHitChance(actor, enemy, value) / 100.f;
|
||||||
|
rating *= std::min(1.f, std::max(0.01f, chance));
|
||||||
|
|
||||||
if (weapon->mData.mType < ESM::Weapon::Arrow)
|
if (weapon->mData.mType < ESM::Weapon::Arrow)
|
||||||
rating *= weapon->mData.mSpeed;
|
rating *= weapon->mData.mSpeed;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user