mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
Remove redundant else
This commit is contained in:
parent
9cebe78a51
commit
b67ecb4e4f
@ -22,28 +22,26 @@ namespace MWRender
|
|||||||
const osg::ref_ptr<osg::Object> obj = mCache->getRefFromObjectCache(cellIndex);
|
const osg::ref_ptr<osg::Object> obj = mCache->getRefFromObjectCache(cellIndex);
|
||||||
if (obj != nullptr)
|
if (obj != nullptr)
|
||||||
return static_cast<ESMTerrain::LandObject*>(obj.get());
|
return static_cast<ESMTerrain::LandObject*>(obj.get());
|
||||||
|
|
||||||
|
const MWBase::World& world = *MWBase::Environment::get().getWorld();
|
||||||
|
|
||||||
|
if (ESM::isEsm4Ext(cellIndex.mWorldspace))
|
||||||
|
{
|
||||||
|
const ESM4::Land* land = world.getStore().get<ESM4::Land>().search(cellIndex);
|
||||||
|
if (land == nullptr)
|
||||||
|
return nullptr;
|
||||||
|
osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(*land, mLoadFlags));
|
||||||
|
mCache->addEntryToObjectCache(cellIndex, landObj.get());
|
||||||
|
return landObj;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const MWBase::World& world = *MWBase::Environment::get().getWorld();
|
const ESM::Land* land = world.getStore().get<ESM::Land>().search(cellIndex.mX, cellIndex.mY);
|
||||||
|
if (land == nullptr)
|
||||||
if (ESM::isEsm4Ext(cellIndex.mWorldspace))
|
return nullptr;
|
||||||
{
|
osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(*land, mLoadFlags));
|
||||||
const ESM4::Land* land = world.getStore().get<ESM4::Land>().search(cellIndex);
|
mCache->addEntryToObjectCache(cellIndex, landObj.get());
|
||||||
if (land == nullptr)
|
return landObj;
|
||||||
return nullptr;
|
|
||||||
osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(*land, mLoadFlags));
|
|
||||||
mCache->addEntryToObjectCache(cellIndex, landObj.get());
|
|
||||||
return landObj;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const ESM::Land* land = world.getStore().get<ESM::Land>().search(cellIndex.mX, cellIndex.mY);
|
|
||||||
if (land == nullptr)
|
|
||||||
return nullptr;
|
|
||||||
osg::ref_ptr<ESMTerrain::LandObject> landObj(new ESMTerrain::LandObject(*land, mLoadFlags));
|
|
||||||
mCache->addEntryToObjectCache(cellIndex, landObj.get());
|
|
||||||
return landObj;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user