Remove CellStore::searchViaRefNum (replaced with WorldModel::getPtr)

simplify_debugging
Petr Mikheev 2 years ago
parent 270ead937b
commit 93342af1f9

@ -655,13 +655,6 @@ namespace MWWorld
}
};
Ptr CellStore::searchViaRefNum(const ESM::RefNum& refNum)
{
RefNumSearchVisitor searchVisitor(refNum);
forEach(searchVisitor);
return searchVisitor.mFound;
}
float CellStore::getWaterLevel() const
{
if (isExterior())
@ -1046,7 +1039,7 @@ namespace MWWorld
}
// Search for the reference. It might no longer exist if its content file was removed.
Ptr movedRef = searchViaRefNum(refnum);
Ptr movedRef = MWBase::Environment::get().getWorldModel()->getPtr(refnum);
if (movedRef.isEmpty())
{
Log(Debug::Warning) << "Warning: Dropping moved ref tag for " << refnum.mIndex

@ -166,11 +166,6 @@ namespace MWWorld
Ptr searchViaActorId(int id);
///< Will return an empty Ptr if cell is not loaded.
Ptr searchViaRefNum(const ESM::RefNum& refNum);
///< Will return an empty Ptr if cell is not loaded. Does not check references in
/// containers.
/// @note Triggers CellStore hasState flag.
float getWaterLevel() const;
bool movedHere(const MWWorld::Ptr& ptr) const;

@ -1880,14 +1880,7 @@ namespace MWWorld
facedObject = rayToObject.mHitObject;
if (facedObject.isEmpty() && rayToObject.mHitRefnum.isSet())
{
for (CellStore* cellstore : mWorldScene->getActiveCells())
{
facedObject = cellstore->searchViaRefNum(rayToObject.mHitRefnum);
if (!facedObject.isEmpty())
break;
}
}
facedObject = MWBase::Environment::get().getWorldModel()->getPtr(rayToObject.mHitRefnum);
if (rayToObject.mHit)
mDistanceToFacedObject = (rayToObject.mRatio * maxDistance) - camDist;
else
@ -1904,14 +1897,7 @@ namespace MWWorld
res.mHitNormal = rayRes.mHitNormalWorld;
res.mHitObject = rayRes.mHitObject;
if (res.mHitObject.isEmpty() && rayRes.mHitRefnum.isSet())
{
for (CellStore* cellstore : mWorldScene->getActiveCells())
{
res.mHitObject = cellstore->searchViaRefNum(rayRes.mHitRefnum);
if (!res.mHitObject.isEmpty())
break;
}
}
res.mHitObject = MWBase::Environment::get().getWorldModel()->getPtr(rayRes.mHitRefnum);
return res.mHit;
}

Loading…
Cancel
Save