From 4c4ed77bd73534d85a89e247cf9cdb8e724db19e Mon Sep 17 00:00:00 2001 From: "florent.teppe" Date: Wed, 24 May 2023 00:00:40 +0200 Subject: [PATCH] Fixes Quad tree terrain missing in some places the function that queried if data existed or not didn't take the worlspace into account. --- apps/openmw/mwrender/terrainstorage.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/terrainstorage.cpp b/apps/openmw/mwrender/terrainstorage.cpp index 899c035cc6..97ae99cd4f 100644 --- a/apps/openmw/mwrender/terrainstorage.cpp +++ b/apps/openmw/mwrender/terrainstorage.cpp @@ -30,8 +30,14 @@ namespace MWRender { const MWWorld::ESMStore& esmStore = *MWBase::Environment::get().getESMStore(); - const ESM::Land* land = esmStore.get().search(cellLocation.mX, cellLocation.mY); - return land != nullptr; + if (ESM::isEsm4Ext(cellLocation.mWorldspace)) + { + return esmStore.get().search(cellLocation) != nullptr; + } + else + { + return esmStore.get().search(cellLocation.mX, cellLocation.mY) != nullptr; + } } static void BoundUnion(float& minX, float& maxX, float& minY, float& maxY, float x, float y)