mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 14:59:54 +00:00
Fix for some coverity defects
This commit is contained in:
parent
edbac30a57
commit
6b2df95167
2 changed files with 14 additions and 2 deletions
|
@ -2107,6 +2107,9 @@ namespace MWWorld
|
||||||
Ogre::Vector3 playerPos(refdata.getPosition().pos);
|
Ogre::Vector3 playerPos(refdata.getPosition().pos);
|
||||||
|
|
||||||
const OEngine::Physic::PhysicActor *physactor = mPhysEngine->getCharacter(refdata.getHandle());
|
const OEngine::Physic::PhysicActor *physactor = mPhysEngine->getCharacter(refdata.getHandle());
|
||||||
|
if (!physactor)
|
||||||
|
return 0; // shouldn't happen
|
||||||
|
|
||||||
if((!physactor->getOnGround()&&physactor->getCollisionMode()) || isUnderwater(currentCell, playerPos) || isWalkingOnWater(player))
|
if((!physactor->getOnGround()&&physactor->getCollisionMode()) || isUnderwater(currentCell, playerPos) || isWalkingOnWater(player))
|
||||||
return 2;
|
return 2;
|
||||||
if((currentCell->getCell()->mData.mFlags&ESM::Cell::NoSleep) ||
|
if((currentCell->getCell()->mData.mFlags&ESM::Cell::NoSleep) ||
|
||||||
|
@ -2326,9 +2329,15 @@ namespace MWWorld
|
||||||
if (!targetActor.getRefData().getBaseNode() || !targetActor.getRefData().getBaseNode())
|
if (!targetActor.getRefData().getBaseNode() || !targetActor.getRefData().getBaseNode())
|
||||||
return false; // not in active cell
|
return false; // not in active cell
|
||||||
|
|
||||||
Ogre::Vector3 halfExt1 = mPhysEngine->getCharacter(actor.getRefData().getHandle())->getHalfExtents();
|
OEngine::Physic::PhysicActor* actor1 = mPhysEngine->getCharacter(actor.getRefData().getHandle());
|
||||||
|
OEngine::Physic::PhysicActor* actor2 = mPhysEngine->getCharacter(targetActor.getRefData().getHandle());
|
||||||
|
|
||||||
|
if (!actor1 || !actor2)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Ogre::Vector3 halfExt1 = actor1->getHalfExtents();
|
||||||
const float* pos1 = actor.getRefData().getPosition().pos;
|
const float* pos1 = actor.getRefData().getPosition().pos;
|
||||||
Ogre::Vector3 halfExt2 = mPhysEngine->getCharacter(targetActor.getRefData().getHandle())->getHalfExtents();
|
Ogre::Vector3 halfExt2 = actor2->getHalfExtents();
|
||||||
const float* pos2 = targetActor.getRefData().getPosition().pos;
|
const float* pos2 = targetActor.getRefData().getPosition().pos;
|
||||||
|
|
||||||
btVector3 from(pos1[0],pos1[1],pos1[2]+halfExt1.z*2*0.9); // eye level
|
btVector3 from(pos1[0],pos1[1],pos1[2]+halfExt1.z*2*0.9); // eye level
|
||||||
|
|
3
extern/oics/ICSInputControlSystem.cpp
vendored
3
extern/oics/ICSInputControlSystem.cpp
vendored
|
@ -36,6 +36,9 @@ namespace ICS
|
||||||
, mDetectingBindingControl(NULL)
|
, mDetectingBindingControl(NULL)
|
||||||
, mLog(log)
|
, mLog(log)
|
||||||
, mXmouseAxisBinded(false), mYmouseAxisBinded(false)
|
, mXmouseAxisBinded(false), mYmouseAxisBinded(false)
|
||||||
|
, mClientHeight(1)
|
||||||
|
, mClientWidth(1)
|
||||||
|
, mDetectingBindingDirection(Control::STOP)
|
||||||
{
|
{
|
||||||
ICS_LOG(" - Creating InputControlSystem - ");
|
ICS_LOG(" - Creating InputControlSystem - ");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue