From 14b5674d326e2509ceb52411da3651018c3f5eef Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 3 Jul 2022 12:56:17 +0400 Subject: [PATCH] Init missing data members --- apps/essimporter/converter.cpp | 5 +++-- apps/openmw/mwworld/magiceffects.cpp | 2 ++ components/esm4/reader.cpp | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/essimporter/converter.cpp b/apps/essimporter/converter.cpp index ecd315f477..3c08084ca9 100644 --- a/apps/essimporter/converter.cpp +++ b/apps/essimporter/converter.cpp @@ -68,7 +68,7 @@ namespace { if (isIndexedRefId(indexedRefId)) { - int refIndex; + int refIndex = 0; std::string refId; splitIndexedRefId(indexedRefId, refIndex, refId); @@ -354,7 +354,7 @@ namespace ESSImport } else { - int refIndex; + int refIndex = 0; splitIndexedRefId(cellref.mIndexedRefId, refIndex, out.mRefID); std::string idLower = Misc::StringUtils::lowerCase(out.mRefID); @@ -492,6 +492,7 @@ namespace ESSImport out.mSpellId = it->mSPDT.mId.toString(); out.mSpeed = pnam.mSpeed * 0.001f; // not sure where this factor comes from + out.mSlot = 0; esm.startRecord(ESM::REC_MPRJ); out.save(esm); diff --git a/apps/openmw/mwworld/magiceffects.cpp b/apps/openmw/mwworld/magiceffects.cpp index 44c4061832..a99862d489 100644 --- a/apps/openmw/mwworld/magiceffects.cpp +++ b/apps/openmw/mwworld/magiceffects.cpp @@ -62,6 +62,7 @@ namespace MWWorld else params.mType = ESM::ActiveSpells::Type_Permanent; params.mWorsenings = -1; + params.mNextWorsening = ESM::TimeStamp(); int effectIndex = 0; for(const auto& enam : spell->mEffects.mList) { @@ -131,6 +132,7 @@ namespace MWWorld params.mCasterActorId = creatureStats.mActorId; params.mType = ESM::ActiveSpells::Type_Enchantment; params.mWorsenings = -1; + params.mNextWorsening = ESM::TimeStamp(); for(std::size_t effectIndex = 0; effectIndex < oldMagnitudes.size() && effectIndex < enchantment->mEffects.mList.size(); ++effectIndex) { const auto& enam = enchantment->mEffects.mList[effectIndex]; diff --git a/components/esm4/reader.cpp b/components/esm4/reader.cpp index 19649c4fa6..72421711af 100644 --- a/components/esm4/reader.cpp +++ b/components/esm4/reader.cpp @@ -56,11 +56,13 @@ namespace ESM4 { ReaderContext::ReaderContext() : modIndex(0), recHeaderSize(sizeof(RecordHeader)), - filePos(0), recordRead(0), currWorld(0), currCell(0), cellGridValid(false) + filePos(0), fileRead(0), recordRead(0), currWorld(0), currCell(0), cellGridValid(false) { currCellGrid.cellId = 0; currCellGrid.grid.x = 0; currCellGrid.grid.y = 0; + subRecordHeader.typeId = 0; + subRecordHeader.dataSize = 0; } Reader::Reader(Files::IStreamPtr&& esmStream, const std::string& filename)