|
|
@ -1221,11 +1221,11 @@ bool CharacterController::updateWeaponState()
|
|
|
|
bool isStillWeapon = weaptype > WeapType_HandToHand && weaptype < WeapType_Spell &&
|
|
|
|
bool isStillWeapon = weaptype > WeapType_HandToHand && weaptype < WeapType_Spell &&
|
|
|
|
mWeaponType > WeapType_HandToHand && mWeaponType < WeapType_Spell;
|
|
|
|
mWeaponType > WeapType_HandToHand && mWeaponType < WeapType_Spell;
|
|
|
|
|
|
|
|
|
|
|
|
if(weaptype != mWeaponType && !isKnockedOut() &&
|
|
|
|
if(!isKnockedOut() && !isKnockedDown() && !isRecovery())
|
|
|
|
!isKnockedDown() && !isRecovery())
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string weapgroup;
|
|
|
|
std::string weapgroup;
|
|
|
|
if ((!isWerewolf || mWeaponType != WeapType_Spell)
|
|
|
|
if ((!isWerewolf || mWeaponType != WeapType_Spell)
|
|
|
|
|
|
|
|
&& weaptype != mWeaponType
|
|
|
|
&& mUpperBodyState != UpperCharState_UnEquipingWeap
|
|
|
|
&& mUpperBodyState != UpperCharState_UnEquipingWeap
|
|
|
|
&& !isStillWeapon)
|
|
|
|
&& !isStillWeapon)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1250,49 +1250,60 @@ bool CharacterController::updateWeaponState()
|
|
|
|
|
|
|
|
|
|
|
|
float complete;
|
|
|
|
float complete;
|
|
|
|
bool animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete);
|
|
|
|
bool animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete);
|
|
|
|
|
|
|
|
|
|
|
|
if (!animPlaying || complete >= 1.0f)
|
|
|
|
if (!animPlaying || complete >= 1.0f)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
forcestateupdate = true;
|
|
|
|
// Weapon is changed, no current animation (e.g. unequipping or attack).
|
|
|
|
mAnimation->showCarriedLeft(updateCarriedLeftVisible(weaptype));
|
|
|
|
// Start equipping animation now.
|
|
|
|
|
|
|
|
if (weaptype != mWeaponType)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
forcestateupdate = true;
|
|
|
|
|
|
|
|
mAnimation->showCarriedLeft(updateCarriedLeftVisible(weaptype));
|
|
|
|
|
|
|
|
|
|
|
|
getWeaponGroup(weaptype, weapgroup);
|
|
|
|
getWeaponGroup(weaptype, weapgroup);
|
|
|
|
mAnimation->setWeaponGroup(weapgroup);
|
|
|
|
mAnimation->setWeaponGroup(weapgroup);
|
|
|
|
|
|
|
|
|
|
|
|
if (!isStillWeapon)
|
|
|
|
if (!isStillWeapon)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (weaptype == WeapType_None)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Disable current weapon animation manually
|
|
|
|
|
|
|
|
mAnimation->disable(mCurrentWeapon);
|
|
|
|
mAnimation->disable(mCurrentWeapon);
|
|
|
|
|
|
|
|
if (weaptype != WeapType_None)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mAnimation->showWeapons(false);
|
|
|
|
|
|
|
|
mAnimation->play(weapgroup, priorityWeapon,
|
|
|
|
|
|
|
|
MWRender::Animation::BlendMask_All, true,
|
|
|
|
|
|
|
|
1.0f, "equip start", "equip stop", 0.0f, 0);
|
|
|
|
|
|
|
|
mUpperBodyState = UpperCharState_EquipingWeap;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
if(isWerewolf)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mAnimation->showWeapons(false);
|
|
|
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
mAnimation->play(weapgroup, priorityWeapon,
|
|
|
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfEquip");
|
|
|
|
MWRender::Animation::BlendMask_All, true,
|
|
|
|
if(sound)
|
|
|
|
1.0f, "equip start", "equip stop", 0.0f, 0);
|
|
|
|
{
|
|
|
|
mUpperBodyState = UpperCharState_EquipingWeap;
|
|
|
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
|
|
|
|
|
|
|
sndMgr->playSound3D(mPtr, sound->mId, 1.0f, 1.0f);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(isWerewolf)
|
|
|
|
mWeaponType = weaptype;
|
|
|
|
{
|
|
|
|
getWeaponGroup(mWeaponType, mCurrentWeapon);
|
|
|
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
|
|
|
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfEquip");
|
|
|
|
if(!upSoundId.empty() && !isStillWeapon)
|
|
|
|
if(sound)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
|
|
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
|
|
|
sndMgr->playSound3D(mPtr, sound->mId, 1.0f, 1.0f);
|
|
|
|
sndMgr->playSound3D(mPtr, upSoundId, 1.0f, 1.0f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mWeaponType = weaptype;
|
|
|
|
// Make sure that we disabled unequipping animation
|
|
|
|
getWeaponGroup(mWeaponType, mCurrentWeapon);
|
|
|
|
if (mUpperBodyState == UpperCharState_UnEquipingWeap)
|
|
|
|
|
|
|
|
|
|
|
|
if(!upSoundId.empty() && !isStillWeapon)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
|
|
|
mUpperBodyState = UpperCharState_Nothing;
|
|
|
|
sndMgr->playSound3D(mPtr, upSoundId, 1.0f, 1.0f);
|
|
|
|
mAnimation->disable(mCurrentWeapon);
|
|
|
|
|
|
|
|
mWeaponType = WeapType_None;
|
|
|
|
|
|
|
|
getWeaponGroup(mWeaponType, mCurrentWeapon);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|