1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-28 19:21:04 +00:00

Merge pull request #2760 from akortunov/explode

Do not try to launch magic bolt when direction to target is empty
This commit is contained in:
Bret Curtis 2020-04-05 01:17:47 +02:00 committed by GitHub
commit 03da834bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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();