1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

activate whole-body attack animations

This commit is contained in:
mrcheko 2014-02-02 16:29:51 +02:00
parent b85a4dd35e
commit 761f13d3ce
2 changed files with 25 additions and 3 deletions

View file

@ -781,6 +781,13 @@ bool CharacterController::updateWeaponState()
stop = mAttackType+" max attack";
mUpperBodyState = UpperCharState_MinAttackToMaxAttack;
break;
case UpperCharState_MinAttackToMaxAttack:
//hack to avoid body pos desync when jumping/sneaking in 'max attack' state
if(!mAnimation->isPlaying(mCurrentWeapon))
mAnimation->play(mCurrentWeapon, Priority_Weapon,
MWRender::Animation::Group_UpperBody, false,
0, mAttackType+" min attack", mAttackType+" max attack", 0.999f, 0);
break;
case UpperCharState_MaxAttackToMinHit:
if(mAttackType == "shoot")
{
@ -830,6 +837,22 @@ bool CharacterController::updateWeaponState()
}
}
//if playing combat animation and lowerbody is not busy switch to whole body animation
if((weaptype != WeapType_None || UpperCharState_UnEquipingWeap) && animPlaying)
{
if( mMovementState != CharState_None ||
mJumpState != JumpState_None ||
mHitState != CharState_None ||
MWBase::Environment::get().getWorld()->isSwimming(mPtr) ||
cls.getCreatureStats(mPtr).getMovementFlag(CreatureStats::Flag_Sneak))
{
mAnimation->changeGroups(mCurrentWeapon, MWRender::Animation::Group_UpperBody);
}
else
{
mAnimation->changeGroups(mCurrentWeapon, MWRender::Animation::Group_All);
}
}
MWWorld::ContainerStoreIterator torch = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
if(torch != inv.end() && torch->getTypeName() == typeid(ESM::Light).name()

View file

@ -1050,9 +1050,8 @@ bool Animation::allowSwitchViewMode() const
{
for (AnimStateMap::const_iterator stateiter = mStates.begin(); stateiter != mStates.end(); ++stateiter)
{
if(stateiter->second.mGroups == Group_UpperBody
|| (stateiter->first.size()==4 && stateiter->first.find("hit") != std::string::npos)
|| (stateiter->first.find("knock") != std::string::npos) )
if(stateiter->second.mPriority > MWMechanics::Priority_Movement
&& stateiter->second.mPriority < MWMechanics::Priority_Torch)
return false;
}
return true;