mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 06:44:29 +00:00
Use record state to determine if a LandTexture record was defined in the current plugin
This commit is contained in:
parent
cbf0471d8a
commit
ed5bedb9db
@ -384,15 +384,20 @@ CSMWorld::LandTextureIdTable::ImportResults CSMWorld::LandTextureIdTable::import
|
|||||||
const ESM::RefId refId = ESM::RefId::stringRefId(id);
|
const ESM::RefId refId = ESM::RefId::stringRefId(id);
|
||||||
const int oldRow = idCollection()->searchId(refId);
|
const int oldRow = idCollection()->searchId(refId);
|
||||||
|
|
||||||
// If it does not exist or it is in the current plugin, it can be skipped.
|
// If it does not exist, it can be skipped.
|
||||||
if (oldRow < 0 || plugin == 0)
|
if (oldRow < 0)
|
||||||
{
|
{
|
||||||
results.recordMapping.emplace_back(id, id);
|
results.recordMapping.emplace_back(id, id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for a pre-existing record
|
// Look for a pre-existing record
|
||||||
auto& record = static_cast<const Record<LandTexture>&>(idCollection()->getRecord(oldRow));
|
auto& record = static_cast<const Record<LandTexture>&>(idCollection()->getRecord(oldRow));
|
||||||
|
// If it is in the current plugin, it can be skipped.
|
||||||
|
if (record.mState == Record<LandTexture>::State_ModifiedOnly)
|
||||||
|
{
|
||||||
|
results.recordMapping.emplace_back(id, id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
std::string texture = Misc::StringUtils::lowerCase(record.get().mTexture);
|
std::string texture = Misc::StringUtils::lowerCase(record.get().mTexture);
|
||||||
auto searchIt = reverseLookupMap.find(texture);
|
auto searchIt = reverseLookupMap.find(texture);
|
||||||
if (searchIt != reverseLookupMap.end())
|
if (searchIt != reverseLookupMap.end())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user