Only set attack type randomly if "best attack" is on (bug #4942)

pull/541/head
Capostrophic 6 years ago
parent a5504f8cc1
commit 80a65e81dd

@ -50,6 +50,7 @@
Bug #4916: Specular power (shininess) material parameter is ignored when shaders are used.
Bug #4922: Werewolves can not attack if the transformation happens during attack
Bug #4938: Strings from subrecords with actually empty headers can't be empty
Bug #4942: Hand-to-Hand attack type is chosen randomly when "always use best attack" is turned off
Feature #2229: Improve pathfinding AI
Feature #3442: Default values for fallbacks from ini file
Feature #3610: Option to invert X axis

@ -1630,23 +1630,25 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
else
{
if(mPtr == getPlayer())
{
if (isWeapon)
{
if (Settings::Manager::getBool("best attack", "Game"))
{
if (isWeapon)
{
MWWorld::ConstContainerStoreIterator weapon = mPtr.getClass().getInventoryStore(mPtr).getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
mAttackType = getBestAttack(weapon->get<ESM::Weapon>()->mBase);
}
else
setAttackTypeBasedOnMovement();
}
else
{
// There is no "best attack" for Hand-to-Hand
setAttackTypeRandomly(mAttackType);
}
}
else
{
setAttackTypeBasedOnMovement();
}
}
// else if (mPtr != getPlayer()) use mAttackType set by AiCombat
startKey = mAttackType+" start";
stopKey = mAttackType+" min attack";

Loading…
Cancel
Save