|
|
|
@ -46,9 +46,12 @@ bool MWMechanics::AiCast::execute(const MWWorld::Ptr& actor, MWMechanics::Charac
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
osg::Vec3f targetPos = target.getRefData().getPosition().asVec3();
|
|
|
|
|
if (target.getClass().isActor())
|
|
|
|
|
// If the target of an on-target spell is an actor that is not the caster
|
|
|
|
|
// the target position must be adjusted so that it's not casted at the actor's feet.
|
|
|
|
|
if (target != actor && target.getClass().isActor())
|
|
|
|
|
{
|
|
|
|
|
osg::Vec3f halfExtents = MWBase::Environment::get().getWorld()->getHalfExtents(target);
|
|
|
|
|
targetPos.z() += halfExtents.z() * 2 * 0.75f;
|
|
|
|
@ -65,7 +68,6 @@ bool MWMechanics::AiCast::execute(const MWWorld::Ptr& actor, MWMechanics::Charac
|
|
|
|
|
|
|
|
|
|
if (!turned)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check if the actor is already casting another spell
|
|
|
|
|
bool isCasting = MWBase::Environment::get().getMechanicsManager()->isCastingSpell(actor);
|
|
|
|
|