forked from mirror/openmw-tes3mp
Ignore the collision box offset when launching projectiles (Fixes #3201)
This commit is contained in:
parent
c6601ab2ab
commit
a85932a62b
1 changed files with 6 additions and 4 deletions
|
@ -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…
Reference in a new issue