Ignore the collision box offset when launching projectiles (Fixes #3201)

pull/1/head
scrawl 9 years ago
parent c6601ab2ab
commit a85932a62b

@ -117,11 +117,13 @@ namespace MWWorld
const ESM::EffectList &effects, const Ptr &caster, const std::string &sourceName,
const osg::Vec3f& fallbackDirection)
{
osg::Vec3f pos;
osg::Vec3f pos = caster.getRefData().getPosition().asVec3();
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();
{
// Spawn at 0.75 * ActorHeight
// Note: we ignore the collision box offset, this is required to make some flying creatures work as intended.
pos.z() += mPhysics->getHalfExtents(caster).z() * 2 * 0.75;
}
if (MWBase::Environment::get().getWorld()->isUnderwater(caster.getCell(), pos)) // Underwater casting not possible
return;

Loading…
Cancel
Save