mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 07:45:39 +00:00
Avoid problems if builtin.omwscripts
is above Morrowind.esm
in content list.
This commit is contained in:
parent
3941c42a71
commit
ded8997362
3 changed files with 16 additions and 6 deletions
|
@ -165,9 +165,15 @@ namespace MWWorld
|
|||
|
||||
listener->loadingOff();
|
||||
|
||||
// insert records that may not be present in all versions of MW
|
||||
if (mEsm[0].getFormat() == 0)
|
||||
ensureNeededRecords();
|
||||
// Find main game file
|
||||
for (const ESM::ESMReader& reader : mEsm)
|
||||
{
|
||||
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());
|
||||
|
||||
|
|
|
@ -430,6 +430,10 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
|
|||
if (item(info.fileName()))
|
||||
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))
|
||||
{
|
||||
EsmFile *file = new EsmFile(path2);
|
||||
|
|
|
@ -32,14 +32,14 @@ public:
|
|||
int getVer() const { return mHeader.mData.version; }
|
||||
int getRecordCount() const { return mHeader.mData.records; }
|
||||
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 getDesc() const { return mHeader.mData.desc; }
|
||||
const std::string& getAuthor() const { return mHeader.mData.author; }
|
||||
const std::string& getDesc() const { return mHeader.mData.desc; }
|
||||
const std::vector<Header::MasterData> &getGameFiles() const { return mHeader.mMaster; }
|
||||
const Header& getHeader() const { return mHeader; }
|
||||
int getFormat() const { return mHeader.mFormat; };
|
||||
const NAME &retSubName() const { return mCtx.subName; }
|
||||
uint32_t getSubSize() const { return mCtx.leftSub; }
|
||||
std::string getName() const {return mCtx.filename; };
|
||||
const std::string& getName() const { return mCtx.filename; };
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue