forked from mirror/openmw-tes3mp
Don't block hits when in hand-to-hand combat (shield not visible)
This commit is contained in:
parent
0063b63ae4
commit
3d103f3785
1 changed files with 7 additions and 0 deletions
|
@ -73,9 +73,16 @@ namespace MWMechanics
|
|||
return false;
|
||||
|
||||
MWMechanics::CreatureStats& blockerStats = blocker.getClass().getCreatureStats(blocker);
|
||||
|
||||
// Don't block when in spellcasting state (shield is equipped, but not visible)
|
||||
if (blockerStats.getDrawState() == DrawState_Spell)
|
||||
return false;
|
||||
|
||||
// Don't block when in hand-to-hand combat (shield is equipped, but not visible)
|
||||
if (blockerStats.getDrawState() == DrawState_Weapon &&
|
||||
inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight) == inv.end())
|
||||
return false;
|
||||
|
||||
MWMechanics::CreatureStats& attackerStats = attacker.getClass().getCreatureStats(attacker);
|
||||
|
||||
float blockTerm = blocker.getClass().getSkill(blocker, ESM::Skill::Block) + 0.2 * blockerStats.getAttribute(ESM::Attribute::Agility).getModified()
|
||||
|
|
Loading…
Reference in a new issue