mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 00:06:43 +00:00
Fix attack after shoot
This commit is contained in:
parent
dcd381049c
commit
8a48258b1b
1 changed files with 6 additions and 19 deletions
|
@ -1385,14 +1385,6 @@ bool CharacterController::updateWeaponState()
|
||||||
MWBase::Environment::get().getWorld()->breakInvisibility(mPtr);
|
MWBase::Environment::get().getWorld()->breakInvisibility(mPtr);
|
||||||
mAttackStrength = 0;
|
mAttackStrength = 0;
|
||||||
|
|
||||||
// Randomize attacks for non-bipedal creatures with Weapon flag
|
|
||||||
if (mPtr.getClass().getTypeName() == typeid(ESM::Creature).name() &&
|
|
||||||
!mPtr.getClass().isBipedal(mPtr) &&
|
|
||||||
(!mAnimation->hasAnimation(mCurrentWeapon) || isRandomAttackAnimation(mCurrentWeapon)))
|
|
||||||
{
|
|
||||||
mCurrentWeapon = chooseRandomAttackAnimation();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mWeaponType == WeapType_Spell)
|
if(mWeaponType == WeapType_Spell)
|
||||||
{
|
{
|
||||||
// Unset casting flag, otherwise pressing the mouse button down would
|
// Unset casting flag, otherwise pressing the mouse button down would
|
||||||
|
@ -1401,15 +1393,10 @@ bool CharacterController::updateWeaponState()
|
||||||
if (mPtr == player)
|
if (mPtr == player)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld()->getPlayer().setAttackingOrSpell(false);
|
MWBase::Environment::get().getWorld()->getPlayer().setAttackingOrSpell(false);
|
||||||
}
|
|
||||||
|
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
// For the player, set the spell we want to cast
|
||||||
|
// This has to be done at the start of the casting animation,
|
||||||
// For the player, set the spell we want to cast
|
// *not* when selecting a spell in the GUI (otherwise you could change the spell mid-animation)
|
||||||
// This has to be done at the start of the casting animation,
|
|
||||||
// *not* when selecting a spell in the GUI (otherwise you could change the spell mid-animation)
|
|
||||||
if (mPtr == player)
|
|
||||||
{
|
|
||||||
std::string selectedSpell = MWBase::Environment::get().getWindowManager()->getSelectedSpell();
|
std::string selectedSpell = MWBase::Environment::get().getWindowManager()->getSelectedSpell();
|
||||||
stats.getSpells().setSelectedSpell(selectedSpell);
|
stats.getSpells().setSelectedSpell(selectedSpell);
|
||||||
}
|
}
|
||||||
|
@ -1421,6 +1408,7 @@ bool CharacterController::updateWeaponState()
|
||||||
MWMechanics::CastSpell cast(mPtr, NULL, false, mCastingManualSpell);
|
MWMechanics::CastSpell cast(mPtr, NULL, false, mCastingManualSpell);
|
||||||
cast.playSpellCastingEffects(spellid);
|
cast.playSpellCastingEffects(spellid);
|
||||||
|
|
||||||
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Spell *spell = store.get<ESM::Spell>().find(spellid);
|
const ESM::Spell *spell = store.get<ESM::Spell>().find(spellid);
|
||||||
const ESM::ENAMstruct &lastEffect = spell->mEffects.mList.back();
|
const ESM::ENAMstruct &lastEffect = spell->mEffects.mList.back();
|
||||||
const ESM::MagicEffect *effect;
|
const ESM::MagicEffect *effect;
|
||||||
|
@ -1520,13 +1508,12 @@ bool CharacterController::updateWeaponState()
|
||||||
startKey = mAttackType+" start";
|
startKey = mAttackType+" start";
|
||||||
stopKey = mAttackType+" min attack";
|
stopKey = mAttackType+" min attack";
|
||||||
}
|
}
|
||||||
|
else if (isRandomAttackAnimation(mCurrentWeapon))
|
||||||
if (isRandomAttackAnimation(mCurrentWeapon))
|
|
||||||
{
|
{
|
||||||
startKey = "start";
|
startKey = "start";
|
||||||
stopKey = "stop";
|
stopKey = "stop";
|
||||||
}
|
}
|
||||||
else if (mAttackType != "shoot")
|
else
|
||||||
{
|
{
|
||||||
if(mPtr == getPlayer())
|
if(mPtr == getPlayer())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue