forked from teamnwah/openmw-tes3coop
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 ESM::EffectList &effects, const Ptr &caster, const std::string &sourceName,
|
||||||
const osg::Vec3f& fallbackDirection)
|
const osg::Vec3f& fallbackDirection)
|
||||||
{
|
{
|
||||||
osg::Vec3f pos;
|
osg::Vec3f pos = caster.getRefData().getPosition().asVec3();
|
||||||
if (caster.getClass().isActor())
|
if (caster.getClass().isActor())
|
||||||
pos = mPhysics->getCollisionObjectPosition(caster) + osg::Vec3f(0,0,mPhysics->getHalfExtents(caster).z() * 0.5); // Spawn at 0.75 * ActorHeight
|
{
|
||||||
else
|
// Spawn at 0.75 * ActorHeight
|
||||||
pos = caster.getRefData().getPosition().asVec3();
|
// 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
|
if (MWBase::Environment::get().getWorld()->isUnderwater(caster.getCell(), pos)) // Underwater casting not possible
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue