mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 19:53:53 +00:00
Fix issues, found by CoverityScan
This commit is contained in:
parent
02d7b13075
commit
a68d9aed4c
5 changed files with 13 additions and 15 deletions
|
@ -719,16 +719,14 @@ void CSVRender::InstanceMode::dropInstance(DropMode dropMode, CSVRender::Object*
|
||||||
|
|
||||||
mParentNode->accept(visitor);
|
mParentNode->accept(visitor);
|
||||||
|
|
||||||
for (osgUtil::LineSegmentIntersector::Intersections::iterator it = intersector->getIntersections().begin();
|
osgUtil::LineSegmentIntersector::Intersections::iterator it = intersector->getIntersections().begin();
|
||||||
it != intersector->getIntersections().end(); ++it)
|
if (it != intersector->getIntersections().end())
|
||||||
{
|
{
|
||||||
osgUtil::LineSegmentIntersector::Intersection intersection = *it;
|
osgUtil::LineSegmentIntersector::Intersection intersection = *it;
|
||||||
ESM::Position position = object->getPosition();
|
ESM::Position position = object->getPosition();
|
||||||
object->setEdited (Object::Override_Position);
|
object->setEdited (Object::Override_Position);
|
||||||
position.pos[2] = intersection.getWorldIntersectPoint().z() + objectHeight;
|
position.pos[2] = intersection.getWorldIntersectPoint().z() + objectHeight;
|
||||||
object->setPosition(position.pos);
|
object->setPosition(position.pos);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -753,8 +751,8 @@ float CSVRender::InstanceMode::getDropHeight(DropMode dropMode, CSVRender::Objec
|
||||||
|
|
||||||
mParentNode->accept(visitor);
|
mParentNode->accept(visitor);
|
||||||
|
|
||||||
for (osgUtil::LineSegmentIntersector::Intersections::iterator it = intersector->getIntersections().begin();
|
osgUtil::LineSegmentIntersector::Intersections::iterator it = intersector->getIntersections().begin();
|
||||||
it != intersector->getIntersections().end(); ++it)
|
if (it != intersector->getIntersections().end())
|
||||||
{
|
{
|
||||||
osgUtil::LineSegmentIntersector::Intersection intersection = *it;
|
osgUtil::LineSegmentIntersector::Intersection intersection = *it;
|
||||||
float collisionLevel = intersection.getWorldIntersectPoint().z();
|
float collisionLevel = intersection.getWorldIntersectPoint().z();
|
||||||
|
|
|
@ -31,6 +31,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
AlchemyWindow::AlchemyWindow()
|
AlchemyWindow::AlchemyWindow()
|
||||||
: WindowBase("openmw_alchemy_window.layout")
|
: WindowBase("openmw_alchemy_window.layout")
|
||||||
|
, mCurrentFilter(FilterType::ByName)
|
||||||
, mModel(nullptr)
|
, mModel(nullptr)
|
||||||
, mSortModel(nullptr)
|
, mSortModel(nullptr)
|
||||||
, mAlchemy(new MWMechanics::Alchemy())
|
, mAlchemy(new MWMechanics::Alchemy())
|
||||||
|
@ -192,16 +193,16 @@ namespace MWGui
|
||||||
std::set<std::string> itemNames, itemEffects;
|
std::set<std::string> itemNames, itemEffects;
|
||||||
for (size_t i = 0; i < mModel->getItemCount(); ++i)
|
for (size_t i = 0; i < mModel->getItemCount(); ++i)
|
||||||
{
|
{
|
||||||
auto const& base = mModel->getItem(i).mBase;
|
MWWorld::Ptr item = mModel->getItem(i).mBase;
|
||||||
if (base.getTypeName() != typeid(ESM::Ingredient).name())
|
if (item.getTypeName() != typeid(ESM::Ingredient).name())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
itemNames.insert(base.getClass().getName(base));
|
itemNames.insert(item.getClass().getName(item));
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
auto const alchemySkill = player.getClass().getSkill(player, ESM::Skill::Alchemy);
|
auto const alchemySkill = player.getClass().getSkill(player, ESM::Skill::Alchemy);
|
||||||
|
|
||||||
auto const effects = MWMechanics::Alchemy::effectsDescription(base, alchemySkill);
|
auto const effects = MWMechanics::Alchemy::effectsDescription(item, alchemySkill);
|
||||||
itemEffects.insert(effects.begin(), effects.end());
|
itemEffects.insert(effects.begin(), effects.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1146,8 +1146,6 @@ namespace MWInput
|
||||||
default:
|
default:
|
||||||
return 0.f;
|
return 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0.f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputManager::displayOrientationChanged()
|
void InputManager::displayOrientationChanged()
|
||||||
|
|
|
@ -30,9 +30,11 @@ namespace ESM
|
||||||
// The tmp buffer is a null-byte separated string list, we
|
// The tmp buffer is a null-byte separated string list, we
|
||||||
// just have to pick out one string at a time.
|
// just have to pick out one string at a time.
|
||||||
char* str = tmp.data();
|
char* str = tmp.data();
|
||||||
if (!str && mVarNames.size() > 0)
|
if (!str)
|
||||||
{
|
{
|
||||||
|
if (mVarNames.size() > 0)
|
||||||
Log(Debug::Warning) << "SCVR with no variable names";
|
Log(Debug::Warning) << "SCVR with no variable names";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ namespace Terrain
|
||||||
osg::Group *mRoot;
|
osg::Group *mRoot;
|
||||||
|
|
||||||
CellGrid mCellBorderNodes;
|
CellGrid mCellBorderNodes;
|
||||||
int mBorderMask;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue