Merge pull request #2235 from akortunov/aifix

[0.45 regression] Fix AI regressions
openmw-45 openmw-0.45.0
Bret Curtis 5 years ago
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…
Cancel
Save