mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 09:09:42 +00:00
Removed unused variable, factorised code.
This commit is contained in:
parent
3d06cabf6a
commit
39cfe9c2fb
1 changed files with 3 additions and 7 deletions
|
@ -1167,8 +1167,6 @@ namespace MWWorld
|
|||
cellY = mCurrentGridCenter.y();
|
||||
ESM::RefId extWorldspace = mWorld.getCurrentWorldspace();
|
||||
|
||||
osg::Vec2 center = ESM::indexToPosition(ESM::ExteriorCellIndex(cellX, cellY, extWorldspace), true);
|
||||
|
||||
bool esm4Ext = ESM::isEsm4Ext(extWorldspace);
|
||||
float cellSize = ESM::getCellSize(esm4Ext);
|
||||
|
||||
|
@ -1179,9 +1177,8 @@ namespace MWWorld
|
|||
if (dy != halfGridSizePlusOne && dy != -halfGridSizePlusOne && dx != halfGridSizePlusOne
|
||||
&& dx != -halfGridSizePlusOne)
|
||||
continue; // only care about the outer (not yet loaded) part of the grid
|
||||
|
||||
osg::Vec2 thisCellCenter
|
||||
= ESM::indexToPosition(ESM::ExteriorCellIndex(cellX + dx, cellY + dy, extWorldspace), true);
|
||||
ESM::ExteriorCellIndex cellIndex(cellX + dx, cellY + dy, extWorldspace);
|
||||
osg::Vec2 thisCellCenter = ESM::indexToPosition(cellIndex, true);
|
||||
|
||||
float dist = std::max(
|
||||
std::abs(thisCellCenter.x() - playerPos.x()), std::abs(thisCellCenter.y() - playerPos.y()));
|
||||
|
@ -1191,8 +1188,7 @@ namespace MWWorld
|
|||
float loadDist = cellSize / 2 + cellSize - mCellLoadingThreshold + mPreloadDistance;
|
||||
|
||||
if (dist < loadDist)
|
||||
preloadCell(mWorld.getWorldModel().getExterior(
|
||||
ESM::ExteriorCellIndex(cellX + dx, cellY + dy, extWorldspace)));
|
||||
preloadCell(mWorld.getWorldModel().getExterior(cellIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue