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