From cbb22f0f63deac9f263cd3aebaadf34f0b244281 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 28 Jun 2019 15:52:37 +0300 Subject: [PATCH] Correct cast style behavior when there's no object (bug #5075) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/enchanting.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4770d0a24..f55284fab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,7 @@ Bug #5060: Magic effect visuals stop when death animation begins instead of when it ends Bug #5063: Shape named "Tri Shadow" in creature mesh is visible if it isn't hidden Bug #5069: Blocking creatures' attacks doesn't degrade shields + Bug #5075: Enchanting cast style can be changed if there's no object Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/apps/openmw/mwmechanics/enchanting.cpp b/apps/openmw/mwmechanics/enchanting.cpp index 0e7fa5ec0..20ba99825 100644 --- a/apps/openmw/mwmechanics/enchanting.cpp +++ b/apps/openmw/mwmechanics/enchanting.cpp @@ -102,10 +102,7 @@ namespace MWMechanics void Enchanting::nextCastStyle() { if (itemEmpty()) - { - mCastStyle = ESM::Enchantment::WhenUsed; return; - } const bool powerfulSoul = getGemCharge() >= \ MWBase::Environment::get().getWorld()->getStore().get().find ("iSoulAmountForConstantEffect")->mValue.getInteger(); @@ -267,6 +264,8 @@ namespace MWMechanics void Enchanting::setEnchanter(const MWWorld::Ptr& enchanter) { mEnchanter = enchanter; + // Reset cast style + mCastStyle = ESM::Enchantment::CastOnce; } int Enchanting::getEnchantChance() const