mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-09 21:44:54 +00:00
Removed unused variable, factorised code.
This commit is contained in:
parent
3d06cabf6a
commit
39cfe9c2fb
@ -1167,8 +1167,6 @@ namespace MWWorld
|
|||||||
cellY = mCurrentGridCenter.y();
|
cellY = mCurrentGridCenter.y();
|
||||||
ESM::RefId extWorldspace = mWorld.getCurrentWorldspace();
|
ESM::RefId extWorldspace = mWorld.getCurrentWorldspace();
|
||||||
|
|
||||||
osg::Vec2 center = ESM::indexToPosition(ESM::ExteriorCellIndex(cellX, cellY, extWorldspace), true);
|
|
||||||
|
|
||||||
bool esm4Ext = ESM::isEsm4Ext(extWorldspace);
|
bool esm4Ext = ESM::isEsm4Ext(extWorldspace);
|
||||||
float cellSize = ESM::getCellSize(esm4Ext);
|
float cellSize = ESM::getCellSize(esm4Ext);
|
||||||
|
|
||||||
@ -1179,9 +1177,8 @@ namespace MWWorld
|
|||||||
if (dy != halfGridSizePlusOne && dy != -halfGridSizePlusOne && dx != halfGridSizePlusOne
|
if (dy != halfGridSizePlusOne && dy != -halfGridSizePlusOne && dx != halfGridSizePlusOne
|
||||||
&& dx != -halfGridSizePlusOne)
|
&& dx != -halfGridSizePlusOne)
|
||||||
continue; // only care about the outer (not yet loaded) part of the grid
|
continue; // only care about the outer (not yet loaded) part of the grid
|
||||||
|
ESM::ExteriorCellIndex cellIndex(cellX + dx, cellY + dy, extWorldspace);
|
||||||
osg::Vec2 thisCellCenter
|
osg::Vec2 thisCellCenter = ESM::indexToPosition(cellIndex, true);
|
||||||
= ESM::indexToPosition(ESM::ExteriorCellIndex(cellX + dx, cellY + dy, extWorldspace), true);
|
|
||||||
|
|
||||||
float dist = std::max(
|
float dist = std::max(
|
||||||
std::abs(thisCellCenter.x() - playerPos.x()), std::abs(thisCellCenter.y() - playerPos.y()));
|
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;
|
float loadDist = cellSize / 2 + cellSize - mCellLoadingThreshold + mPreloadDistance;
|
||||||
|
|
||||||
if (dist < loadDist)
|
if (dist < loadDist)
|
||||||
preloadCell(mWorld.getWorldModel().getExterior(
|
preloadCell(mWorld.getWorldModel().getExterior(cellIndex));
|
||||||
ESM::ExteriorCellIndex(cellX + dx, cellY + dy, extWorldspace)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user