mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-23 19:20:56 +00:00
Merge branch 'consecutiveseriouspunches' into 'master'
Don't process unexpected hit text keys (bug #7042) Closes #7042 See merge request OpenMW/openmw!2473
This commit is contained in:
commit
48232bfece
@ -21,6 +21,7 @@
|
|||||||
Bug #6993: Shooting your last round of ammunition causes the attack animation to cancel
|
Bug #6993: Shooting your last round of ammunition causes the attack animation to cancel
|
||||||
Bug #7009: Falling actors teleport to the ground without receiving any damage on cell loading
|
Bug #7009: Falling actors teleport to the ground without receiving any damage on cell loading
|
||||||
Bug #7034: Misc items defined in one content file are not treated as keys if another content file uses them as such
|
Bug #7034: Misc items defined in one content file are not treated as keys if another content file uses them as such
|
||||||
|
Bug #7042: Weapon follow animations that immediately follow the hit animations cause multiple hits
|
||||||
Bug #7044: Changing a class' services does not affect autocalculated NPCs
|
Bug #7044: Changing a class' services does not affect autocalculated NPCs
|
||||||
Feature #6933: Support high-resolution cursor textures
|
Feature #6933: Support high-resolution cursor textures
|
||||||
Feature #6945: Support S3TC-compressed and BGR/BGRA NiPixelData
|
Feature #6945: Support S3TC-compressed and BGR/BGRA NiPixelData
|
||||||
|
@ -1061,25 +1061,31 @@ namespace MWMechanics
|
|||||||
else
|
else
|
||||||
mAnimation->showWeapons(false);
|
mAnimation->showWeapons(false);
|
||||||
}
|
}
|
||||||
else if (action == "chop hit")
|
else if (action == "chop hit" || action == "slash hit" || action == "thrust hit" || action == "hit")
|
||||||
charClass.hit(mPtr, mAttackStrength, ESM::Weapon::AT_Chop, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
{
|
||||||
else if (action == "slash hit")
|
int attackType = -1;
|
||||||
charClass.hit(mPtr, mAttackStrength, ESM::Weapon::AT_Slash, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
if (action == "hit")
|
||||||
else if (action == "thrust hit")
|
|
||||||
charClass.hit(mPtr, mAttackStrength, ESM::Weapon::AT_Thrust, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
|
||||||
else if (action == "hit")
|
|
||||||
{
|
{
|
||||||
if (groupname == "attack1" || groupname == "swimattack1")
|
if (groupname == "attack1" || groupname == "swimattack1")
|
||||||
charClass.hit(
|
attackType = ESM::Weapon::AT_Chop;
|
||||||
mPtr, mAttackStrength, ESM::Weapon::AT_Chop, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
|
||||||
else if (groupname == "attack2" || groupname == "swimattack2")
|
else if (groupname == "attack2" || groupname == "swimattack2")
|
||||||
charClass.hit(
|
attackType = ESM::Weapon::AT_Slash;
|
||||||
mPtr, mAttackStrength, ESM::Weapon::AT_Slash, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
|
||||||
else if (groupname == "attack3" || groupname == "swimattack3")
|
else if (groupname == "attack3" || groupname == "swimattack3")
|
||||||
charClass.hit(
|
attackType = ESM::Weapon::AT_Thrust;
|
||||||
mPtr, mAttackStrength, ESM::Weapon::AT_Thrust, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
}
|
||||||
else
|
else if (action == "chop hit")
|
||||||
charClass.hit(mPtr, mAttackStrength, -1, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
attackType = ESM::Weapon::AT_Chop;
|
||||||
|
else if (action == "slash hit")
|
||||||
|
attackType = ESM::Weapon::AT_Slash;
|
||||||
|
else if (action == "thrust hit")
|
||||||
|
attackType = ESM::Weapon::AT_Thrust;
|
||||||
|
// We want to avoid hit keys that come out of nowhere (e.g. in the follow animation)
|
||||||
|
// and processing multiple hit keys for a single attack
|
||||||
|
if (mAttackStrength != -1.f)
|
||||||
|
{
|
||||||
|
charClass.hit(mPtr, mAttackStrength, attackType, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
||||||
|
mAttackStrength = -1.f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (isRandomAttackAnimation(groupname) && action == "start")
|
else if (isRandomAttackAnimation(groupname) && action == "start")
|
||||||
{
|
{
|
||||||
@ -1102,7 +1108,7 @@ namespace MWMechanics
|
|||||||
}
|
}
|
||||||
++hitKey;
|
++hitKey;
|
||||||
}
|
}
|
||||||
if (!hasHitKey)
|
if (!hasHitKey && mAttackStrength != -1.f)
|
||||||
{
|
{
|
||||||
if (groupname == "attack1" || groupname == "swimattack1")
|
if (groupname == "attack1" || groupname == "swimattack1")
|
||||||
charClass.hit(
|
charClass.hit(
|
||||||
@ -1113,12 +1119,20 @@ namespace MWMechanics
|
|||||||
else if (groupname == "attack3" || groupname == "swimattack3")
|
else if (groupname == "attack3" || groupname == "swimattack3")
|
||||||
charClass.hit(
|
charClass.hit(
|
||||||
mPtr, mAttackStrength, ESM::Weapon::AT_Thrust, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
mPtr, mAttackStrength, ESM::Weapon::AT_Thrust, mAttackVictim, mAttackHitPos, mAttackSuccess);
|
||||||
|
mAttackStrength = -1.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (action == "shoot attach")
|
else if (action == "shoot attach")
|
||||||
mAnimation->attachArrow();
|
mAnimation->attachArrow();
|
||||||
else if (action == "shoot release")
|
else if (action == "shoot release")
|
||||||
|
{
|
||||||
|
// See notes for melee release above
|
||||||
|
if (mAttackStrength != -1.f)
|
||||||
|
{
|
||||||
mAnimation->releaseArrow(mAttackStrength);
|
mAnimation->releaseArrow(mAttackStrength);
|
||||||
|
mAttackStrength = -1.f;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (action == "shoot follow attach")
|
else if (action == "shoot follow attach")
|
||||||
mAnimation->attachArrow();
|
mAnimation->attachArrow();
|
||||||
// Make sure this key is actually for the RangeType we are casting. The flame atronach has
|
// Make sure this key is actually for the RangeType we are casting. The flame atronach has
|
||||||
@ -1446,7 +1460,7 @@ namespace MWMechanics
|
|||||||
if (mUpperBodyState == UpperBodyState::WeaponEquipped
|
if (mUpperBodyState == UpperBodyState::WeaponEquipped
|
||||||
&& (mHitState == CharState_None || mHitState == CharState_Block))
|
&& (mHitState == CharState_None || mHitState == CharState_Block))
|
||||||
{
|
{
|
||||||
mAttackStrength = 0;
|
mAttackStrength = -1.f;
|
||||||
|
|
||||||
// Randomize attacks for non-bipedal creatures
|
// Randomize attacks for non-bipedal creatures
|
||||||
if (!cls.isBipedal(mPtr)
|
if (!cls.isBipedal(mPtr)
|
||||||
@ -1731,6 +1745,9 @@ namespace MWMechanics
|
|||||||
stop = strength + ' ' + stop;
|
stop = strength + ' ' + stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset attack strength to make extra sure hits that come out of nowhere aren't processed
|
||||||
|
mAttackStrength = -1.f;
|
||||||
|
|
||||||
if (animPlaying)
|
if (animPlaying)
|
||||||
mAnimation->disable(mCurrentWeapon);
|
mAnimation->disable(mCurrentWeapon);
|
||||||
MWRender::Animation::AnimPriority priorityFollow(priorityWeapon);
|
MWRender::Animation::AnimPriority priorityFollow(priorityWeapon);
|
||||||
|
@ -164,7 +164,7 @@ namespace MWMechanics
|
|||||||
int mWeaponType{ ESM::Weapon::None };
|
int mWeaponType{ ESM::Weapon::None };
|
||||||
std::string mCurrentWeapon;
|
std::string mCurrentWeapon;
|
||||||
|
|
||||||
float mAttackStrength{ 0.f };
|
float mAttackStrength{ -1.f };
|
||||||
MWWorld::Ptr mAttackVictim;
|
MWWorld::Ptr mAttackVictim;
|
||||||
osg::Vec3f mAttackHitPos;
|
osg::Vec3f mAttackHitPos;
|
||||||
bool mAttackSuccess{ false };
|
bool mAttackSuccess{ false };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user