mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 06:55:54 -04:00
Fix the projectile launch position for spells cast from objects (Fixes #3235)
This commit is contained in:
parent
910e41e3c4
commit
004f0d37d5
@ -117,7 +117,11 @@ namespace MWWorld
|
|||||||
const ESM::EffectList &effects, const Ptr &caster, const std::string &sourceName,
|
const ESM::EffectList &effects, const Ptr &caster, const std::string &sourceName,
|
||||||
const osg::Vec3f& fallbackDirection)
|
const osg::Vec3f& fallbackDirection)
|
||||||
{
|
{
|
||||||
osg::Vec3f pos = mPhysics->getCollisionObjectPosition(caster) + osg::Vec3f(0,0,mPhysics->getHalfExtents(caster).z() * 0.5); // Spawn at 0.75 * ActorHeight
|
osg::Vec3f pos;
|
||||||
|
if (caster.getClass().isActor())
|
||||||
|
pos = mPhysics->getCollisionObjectPosition(caster) + osg::Vec3f(0,0,mPhysics->getHalfExtents(caster).z() * 0.5); // Spawn at 0.75 * ActorHeight
|
||||||
|
else
|
||||||
|
pos = caster.getRefData().getPosition().asVec3();
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWorld()->isUnderwater(caster.getCell(), pos)) // Underwater casting not possible
|
if (MWBase::Environment::get().getWorld()->isUnderwater(caster.getCell(), pos)) // Underwater casting not possible
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user