|
|
|
@ -250,6 +250,9 @@ namespace MWMechanics
|
|
|
|
|
if (state == MWMechanics::DrawState_Spell || state == MWMechanics::DrawState_Nothing)
|
|
|
|
|
actorCls.getCreatureStats(actor).setDrawState(MWMechanics::DrawState_Weapon);
|
|
|
|
|
|
|
|
|
|
// TODO: Check equipped weapon and equip a different one if we can't attack with it
|
|
|
|
|
// (e.g. no ammunition, or wrong type of ammunition equipped, etc. autoEquip is not very smart in this regard))
|
|
|
|
|
|
|
|
|
|
//Get weapon speed and range
|
|
|
|
|
MWWorld::ContainerStoreIterator weaponSlot =
|
|
|
|
|
MWMechanics::getActiveWeapon(actorCls.getCreatureStats(actor), actorCls.getInventoryStore(actor), &weaptype);
|
|
|
|
@ -260,8 +263,9 @@ namespace MWMechanics
|
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
|
|
|
|
weapRange = gmst.find("fHandToHandReach")->getFloat();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else if (weaptype != WeapType_PickProbe && weaptype != WeapType_Spell)
|
|
|
|
|
{
|
|
|
|
|
// All other WeapTypes are actually weapons, so get<ESM::Weapon> is safe.
|
|
|
|
|
weapon = weaponSlot->get<ESM::Weapon>()->mBase;
|
|
|
|
|
weapRange = weapon->mData.mReach;
|
|
|
|
|
weapSpeed = weapon->mData.mSpeed;
|
|
|
|
|