1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-09 13:13:34 +00:00

Avoid problems if builtin.omwscripts is above Morrowind.esm in content list.

This commit is contained in:
Petr Mikheev 2021-11-12 19:22:20 +01:00
parent 3941c42a71
commit ded8997362
3 changed files with 16 additions and 6 deletions

View File

@ -165,9 +165,15 @@ namespace MWWorld
listener->loadingOff(); listener->loadingOff();
// insert records that may not be present in all versions of MW // Find main game file
if (mEsm[0].getFormat() == 0) for (const ESM::ESMReader& reader : mEsm)
ensureNeededRecords(); {
if (!Misc::StringUtils::ciEndsWith(reader.getName(), ".esm") && !Misc::StringUtils::ciEndsWith(reader.getName(), ".omwgame"))
continue;
if (reader.getFormat() == 0)
ensureNeededRecords(); // and insert records that may not be present in all versions of MW.
break;
}
mCurrentDate.reset(new DateTimeManager()); mCurrentDate.reset(new DateTimeManager());

View File

@ -430,6 +430,10 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
if (item(info.fileName())) if (item(info.fileName()))
continue; continue;
// Enabled by default in system openmw.cfg; shouldn't be shown in content list.
if (info.fileName().compare("builtin.omwscripts", Qt::CaseInsensitive) == 0)
continue;
if (info.fileName().endsWith(".omwscripts", Qt::CaseInsensitive)) if (info.fileName().endsWith(".omwscripts", Qt::CaseInsensitive))
{ {
EsmFile *file = new EsmFile(path2); EsmFile *file = new EsmFile(path2);

View File

@ -32,14 +32,14 @@ public:
int getVer() const { return mHeader.mData.version; } int getVer() const { return mHeader.mData.version; }
int getRecordCount() const { return mHeader.mData.records; } int getRecordCount() const { return mHeader.mData.records; }
float getFVer() const { return (mHeader.mData.version == VER_12) ? 1.2f : 1.3f; } float getFVer() const { return (mHeader.mData.version == VER_12) ? 1.2f : 1.3f; }
const std::string getAuthor() const { return mHeader.mData.author; } const std::string& getAuthor() const { return mHeader.mData.author; }
const std::string getDesc() const { return mHeader.mData.desc; } const std::string& getDesc() const { return mHeader.mData.desc; }
const std::vector<Header::MasterData> &getGameFiles() const { return mHeader.mMaster; } const std::vector<Header::MasterData> &getGameFiles() const { return mHeader.mMaster; }
const Header& getHeader() const { return mHeader; } const Header& getHeader() const { return mHeader; }
int getFormat() const { return mHeader.mFormat; }; int getFormat() const { return mHeader.mFormat; };
const NAME &retSubName() const { return mCtx.subName; } const NAME &retSubName() const { return mCtx.subName; }
uint32_t getSubSize() const { return mCtx.leftSub; } uint32_t getSubSize() const { return mCtx.leftSub; }
std::string getName() const {return mCtx.filename; }; const std::string& getName() const { return mCtx.filename; };
/************************************************************************* /*************************************************************************
* *