Break invisibility after stopping preparing the attack (bug #5976)

check_span
Alexei Kotov 2 years ago
parent 461fdcd11b
commit 93eb470024

@ -46,6 +46,7 @@
Bug #5863: GetEffect should return true after the player has teleported
Bug #5913: Failed assertion during Ritual of Trees quest
Bug #5937: Lights always need to be rotated by 90 degrees
Bug #5976: Invisibility is broken when the attack starts instead of when it ends
Bug #5978: NPCs and Creatures talk to and headtrack a player character with a 75% chameleon effect or more
Bug #5989: Simple water isn't affected by texture filter settings
Bug #6037: Launcher: Morrowind content language cannot be set to English

@ -1352,7 +1352,6 @@ bool CharacterController::updateState(CharacterState idle)
bool resetIdle = ammunition;
if(mUpperBodyState == UpperCharState_WeapEquiped && (mHitState == CharState_None || mHitState == CharState_Block))
{
world->breakInvisibility(mPtr);
mAttackStrength = 0;
// Randomize attacks for non-bipedal creatures
@ -1397,6 +1396,7 @@ bool CharacterController::updateState(CharacterState idle)
static const bool useCastingAnimations = Settings::Manager::getBool("use magic item animations", "Game");
if (isMagicItem && !useCastingAnimations)
{
world->breakInvisibility(mPtr);
// Enchanted items by default do not use casting animations
world->castSpell(mPtr);
resetIdle = false;
@ -1404,6 +1404,7 @@ bool CharacterController::updateState(CharacterState idle)
}
else if(!spellid.empty() && canCast)
{
world->breakInvisibility(mPtr);
MWMechanics::CastSpell cast(mPtr, nullptr, false, mCastingManualSpell);
cast.playSpellCastingEffects(spellid, isMagicItem);
@ -1476,6 +1477,7 @@ bool CharacterController::updateState(CharacterState idle)
}
else if(mWeaponType == ESM::Weapon::PickProbe)
{
world->breakInvisibility(mPtr);
MWWorld::ContainerStoreIterator weapon = cls.getInventoryStore(mPtr).getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
MWWorld::Ptr item = *weapon;
// TODO: this will only work for the player, and needs to be fixed if NPCs should ever use lockpicks/probes.
@ -1576,6 +1578,7 @@ bool CharacterController::updateState(CharacterState idle)
animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete);
if(mUpperBodyState == UpperCharState_MinAttackToMaxAttack && !isKnockedDown())
{
world->breakInvisibility(mPtr);
float attackStrength = complete;
float minAttackTime = mAnimation->getTextKeyTime(mCurrentWeapon+": "+mAttackType+" "+"min attack");
float maxAttackTime = mAnimation->getTextKeyTime(mCurrentWeapon+": "+mAttackType+" "+"max attack");
@ -1703,6 +1706,7 @@ bool CharacterController::updateState(CharacterState idle)
break;
}
world->breakInvisibility(mPtr);
if(weapclass != ESM::WeaponType::Ranged && weapclass != ESM::WeaponType::Thrown)
playSwishSound(0.0f);
}

Loading…
Cancel
Save