1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

preloader compatible with esm4 exteriors.

This commit is contained in:
florent.teppe 2023-05-09 22:28:37 +02:00
parent 75561abfca
commit f731c5eadb

View File

@ -1102,7 +1102,7 @@ namespace MWWorld
mLastPlayerPos = playerPos;
if (mPreloadEnabled && !ESM::isEsm4Ext(mCurrentCell->getCell()->getWorldSpace()))
if (mPreloadEnabled)
{
if (mPreloadDoors)
preloadTeleportDoorDestinations(playerPos, predictedPos, exteriorPositions);
@ -1277,7 +1277,7 @@ namespace MWWorld
{
const MWWorld::ConstPtr player = mWorld.getPlayerPtr();
ListFastTravelDestinationsVisitor listVisitor(mPreloadDistance, player.getRefData().getPosition().asVec3());
ESM::RefId extWorldspace = mWorld.getCurrentWorldspace();
for (MWWorld::CellStore* cellStore : mActiveCells)
{
cellStore->forEachType<ESM::NPC>(listVisitor);
@ -1293,7 +1293,7 @@ namespace MWWorld
osg::Vec3f pos = dest.mPos.asVec3();
const osg::Vec2i cellIndex = positionToCellIndex(pos.x(), pos.y());
preloadCell(mWorld.getWorldModel().getExterior(
ESM::ExteriorCellIndex(cellIndex.x(), cellIndex.y(), ESM::Cell::sDefaultWorldspaceId)),
ESM::ExteriorCellIndex(cellIndex.x(), cellIndex.y(), extWorldspace)),
true);
exteriorPositions.emplace_back(pos, gridCenterToBounds(getNewGridCenter(pos)));
}