@@ -1104,10 +1104,10 @@ namespace MWMechanics
1104
1104
attackType = ESM::Weapon::AT_Thrust;
1105
1105
// We want to avoid hit keys that come out of nowhere (e.g. in the follow animation)
1106
1106
// and processing multiple hit keys for a single attack
1107
- if (mAttackStrength != - 1 . f )
1107
+ if (mReadyToHit )
1108
1108
{
1109
1109
charClass.hit (mPtr , mAttackStrength , attackType, mAttackVictim , mAttackHitPos , mAttackSuccess );
1110
- mAttackStrength = - 1 . f ;
1110
+ mReadyToHit = false ;
1111
1111
}
1112
1112
}
1113
1113
else if (isRandomAttackAnimation (groupname) && action == " start" )
@@ -1153,10 +1153,10 @@ namespace MWMechanics
1153
1153
else if (action == " shoot release" )
1154
1154
{
1155
1155
// See notes for melee release above
1156
- if (mAttackStrength != - 1 . f )
1156
+ if (mReadyToHit )
1157
1157
{
1158
1158
mAnimation ->releaseArrow (mAttackStrength );
1159
- mAttackStrength = - 1 . f ;
1159
+ mReadyToHit = false ;
1160
1160
}
1161
1161
}
1162
1162
else if (action == " shoot follow attach" )
@@ -1246,7 +1246,7 @@ namespace MWMechanics
1246
1246
1247
1247
void CharacterController::prepareHit ()
1248
1248
{
1249
- if (mAttackStrength != - 1 . f )
1249
+ if (mReadyToHit )
1250
1250
return ;
1251
1251
1252
1252
auto & prng = MWBase::Environment::get ().getWorld ()->getPrng ();
@@ -1261,6 +1261,8 @@ namespace MWMechanics
1261
1261
mAttackStrength = 0 .f ;
1262
1262
playSwishSound ();
1263
1263
}
1264
+
1265
+ mReadyToHit = true ;
1264
1266
}
1265
1267
1266
1268
bool CharacterController::updateWeaponState ()
@@ -1520,6 +1522,7 @@ namespace MWMechanics
1520
1522
&& (mHitState == CharState_None || mHitState == CharState_Block))
1521
1523
{
1522
1524
mAttackStrength = -1 .f ;
1525
+ mReadyToHit = false ;
1523
1526
1524
1527
// Randomize attacks for non-bipedal creatures
1525
1528
if (!cls.isBipedal (mPtr )
@@ -1806,8 +1809,7 @@ namespace MWMechanics
1806
1809
stop = strength + ' ' + stop;
1807
1810
}
1808
1811
1809
- // Reset attack strength to make extra sure hits that come out of nowhere aren't processed
1810
- mAttackStrength = -1 .f ;
1812
+ mReadyToHit = false ;
1811
1813
1812
1814
if (animPlaying)
1813
1815
mAnimation ->disable (mCurrentWeapon );
0 commit comments