Do not try to launch magic bolt when direction to target is empty (bug #5350)

pull/2760/head
Andrei Kortunov 5 years ago
parent bb7c2ac630
commit 7545256d1f

@ -211,6 +211,7 @@
Bug #5326: Formatting issues in the settings.cfg
Bug #5328: Skills aren't properly reset for dead actors
Bug #5345: Dopey Necromancy does not work due to a missing quote
Bug #5350: An attempt to launch magic bolt causes "AL error invalid value" error
Bug #5352: Light source items' duration is decremented while they aren't visible
Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI

@ -291,6 +291,12 @@ namespace MWWorld
if (state.mEffects.mList.empty())
return;
if (!caster.getClass().isActor() && fallbackDirection.length2() <= 0)
{
Log(Debug::Warning) << "Unable to launch magic bolt (direction to target is empty)";
return;
}
MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), state.mIdMagic.at(0));
MWWorld::Ptr ptr = ref.getPtr();

Loading…
Cancel
Save