| 65 | } |
| 66 | |
| 67 | void ESMReader::resolveParentFileIndices(ReadersCache& readers) |
| 68 | { |
| 69 | mCtx.parentFileIndices.clear(); |
| 70 | for (const Header::MasterData& mast : getGameFiles()) |
| 71 | { |
| 72 | const std::string& fname = mast.name; |
| 73 | int index = getIndex(); |
| 74 | for (int i = 0; i < getIndex(); i++) |
| 75 | { |
| 76 | if (readers.getFileSize(static_cast<std::size_t>(i)) == 0) |
| 77 | continue; // Content file in non-ESM format |
| 78 | const auto fnamecandidate |
| 79 | = Files::pathToUnicodeString(readers.getName(static_cast<std::size_t>(i)).filename()); |
| 80 | if (Misc::StringUtils::ciEqual(fname, fnamecandidate)) |
| 81 | { |
| 82 | index = i; |
| 83 | break; |
| 84 | } |
| 85 | } |
| 86 | mCtx.parentFileIndices.push_back(index); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | bool ESMReader::applyContentFileMapping(FormId& id) |
| 91 | { |