From bdda7278c4acf52b9d23950d64314d39d3f86f2a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 6 Feb 2013 12:56:30 -0800 Subject: [PATCH] Use 3/4ths of the physic actor's height to test if swimming --- apps/openmw/mwworld/worldimp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index b599076839..55270280d1 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1336,8 +1336,9 @@ namespace MWWorld float *fpos = object.getRefData().getPosition().pos; Ogre::Vector3 pos(fpos[0], fpos[1], fpos[2]); - /// \fixme should rely on object height - pos.z += 30; + /// \fixme 3/4ths submerged? + const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(object.getRefData().getHandle()); + if(actor) pos.z += actor->getHalfExtents().z * 1.5; return isUnderwater(*object.getCell()->mCell, pos); }