mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-12 21:39:26 +00:00
Merge pull request #2235 from akortunov/aifix
[0.45 regression] Fix AI regressions
This commit is contained in:
parent
1f3813a230
commit
e29e3248fc
@ -171,7 +171,7 @@ namespace MWMechanics
|
||||
|
||||
float rating = rateEffects(enchantment->mEffects, actor, enemy);
|
||||
|
||||
rating *= 2; // prefer rechargable magic items over spells
|
||||
rating *= 1.25f; // prefer rechargable magic items over spells
|
||||
return rating;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,9 @@ namespace MWMechanics
|
||||
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)
|
||||
rating *= weapon->mData.mSpeed;
|
||||
|
Loading…
Reference in New Issue
Block a user