diff --git a/components/esm/aipackage.cpp b/components/esm/aipackage.cpp index cf4951de7..209a1fe26 100644 --- a/components/esm/aipackage.cpp +++ b/components/esm/aipackage.cpp @@ -13,6 +13,7 @@ namespace ESM void AIPackageList::load(ESMReader &esm) { + mList.clear(); while (esm.hasMoreSubs()) { // initialize every iteration AIPackage pack; diff --git a/components/esm/effectlist.cpp b/components/esm/effectlist.cpp index bc126846b..fc9acccf2 100644 --- a/components/esm/effectlist.cpp +++ b/components/esm/effectlist.cpp @@ -7,6 +7,7 @@ namespace ESM { void EffectList::load(ESMReader &esm) { + mList.clear(); ENAMstruct s; while (esm.isNextSub("ENAM")) { esm.getHT(s, 24); diff --git a/components/esm/loadarmo.cpp b/components/esm/loadarmo.cpp index 5bf38c840..f8c3a4718 100644 --- a/components/esm/loadarmo.cpp +++ b/components/esm/loadarmo.cpp @@ -9,6 +9,7 @@ namespace ESM void PartReferenceList::load(ESMReader &esm) { + mParts.clear(); while (esm.isNextSub("INDX")) { PartReference pr; diff --git a/components/esm/loadcont.cpp b/components/esm/loadcont.cpp index 7bdf9f05b..51a385f06 100644 --- a/components/esm/loadcont.cpp +++ b/components/esm/loadcont.cpp @@ -9,6 +9,7 @@ namespace ESM void InventoryList::load(ESMReader &esm) { + mList.clear(); ContItem ci; while (esm.isNextSub("NPCO")) { diff --git a/components/esm/loadnpc.cpp b/components/esm/loadnpc.cpp index 2fe9fe3c1..ef4b5211b 100644 --- a/components/esm/loadnpc.cpp +++ b/components/esm/loadnpc.cpp @@ -51,6 +51,7 @@ void NPC::load(ESMReader &esm) else mHasAI = false; + mTransport.clear(); while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) { if (esm.retSubName() == 0x54444f44) { // DODT struct Dest dodt; diff --git a/components/esm/loadpgrd.cpp b/components/esm/loadpgrd.cpp index efdbdd86b..974e928d9 100644 --- a/components/esm/loadpgrd.cpp +++ b/components/esm/loadpgrd.cpp @@ -27,6 +27,9 @@ void Pathgrid::load(ESMReader &esm) esm.getHNT(mData, "DATA", 12); mCell = esm.getHNString("NAME"); + mPoints.clear(); + mEdges.clear(); + // keep track of total connections so we can reserve edge vector size int edgeCount = 0; diff --git a/components/esm/loadregn.cpp b/components/esm/loadregn.cpp index 0c3ccbffb..1b08b7217 100644 --- a/components/esm/loadregn.cpp +++ b/components/esm/loadregn.cpp @@ -39,6 +39,7 @@ void Region::load(ESMReader &esm) esm.getHNT(mMapColor, "CNAM"); + mSoundList.clear(); while (esm.hasMoreSubs()) { SoundRef sr; diff --git a/components/esm/loadscpt.cpp b/components/esm/loadscpt.cpp index 5a7d65775..19e3f3bb3 100644 --- a/components/esm/loadscpt.cpp +++ b/components/esm/loadscpt.cpp @@ -22,6 +22,8 @@ void Script::load(ESMReader &esm) mData = data.mData; mId = data.mName.toString(); + mVarNames.clear(); + // List of local variables if (esm.isNextSub("SCVR")) { diff --git a/components/esm/spelllist.cpp b/components/esm/spelllist.cpp index 24d3c3d0a..aeface617 100644 --- a/components/esm/spelllist.cpp +++ b/components/esm/spelllist.cpp @@ -7,6 +7,7 @@ namespace ESM { void SpellList::load(ESMReader &esm) { + mList.clear(); while (esm.isNextSub("NPCS")) { mList.push_back(esm.getHString()); }