Skip to content

Commit e62e497

Browse files
committed
Be smarter about dual-wield reactions.
1 parent e03532b commit e62e497

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/Savegame/BattleUnit.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,13 +1780,18 @@ BattleItem *BattleUnit::getMainHandWeapon(bool quickest) const
17801780
// otherwise pick the one with the least snapshot TUs
17811781
int tuRightHand = weaponRightHand->getRules()->getTUSnap();
17821782
int tuLeftHand = weaponLeftHand->getRules()->getTUSnap();
1783-
if (tuLeftHand >= tuRightHand)
1784-
{
1785-
return quickest?weaponRightHand:weaponLeftHand;
1786-
}
1783+
// if only one weapon has snapshot, pick that one
1784+
if (tuLeftHand <= 0 && tuRightHand > 0)
1785+
return weaponRightHand;
1786+
else if (tuRightHand <= 0 && tuLeftHand > 0)
1787+
return weaponLeftHand;
1788+
// else pick the better one
17871789
else
17881790
{
1789-
return quickest?weaponLeftHand:weaponRightHand;
1791+
if (tuLeftHand >= tuRightHand)
1792+
return quickest ? weaponRightHand : weaponLeftHand;
1793+
else
1794+
return quickest ? weaponLeftHand : weaponRightHand;
17901795
}
17911796
}
17921797

0 commit comments

Comments
 (0)