ESM: Make sure to clear old list when a list is overwritten by another content file (Fixes #1932)

deque
scrawl 10 years ago
parent f5868f7ae1
commit dec9ffdb6c

@ -13,6 +13,7 @@ namespace ESM
void AIPackageList::load(ESMReader &esm) void AIPackageList::load(ESMReader &esm)
{ {
mList.clear();
while (esm.hasMoreSubs()) { while (esm.hasMoreSubs()) {
// initialize every iteration // initialize every iteration
AIPackage pack; AIPackage pack;

@ -7,6 +7,7 @@ namespace ESM {
void EffectList::load(ESMReader &esm) void EffectList::load(ESMReader &esm)
{ {
mList.clear();
ENAMstruct s; ENAMstruct s;
while (esm.isNextSub("ENAM")) { while (esm.isNextSub("ENAM")) {
esm.getHT(s, 24); esm.getHT(s, 24);

@ -9,6 +9,7 @@ namespace ESM
void PartReferenceList::load(ESMReader &esm) void PartReferenceList::load(ESMReader &esm)
{ {
mParts.clear();
while (esm.isNextSub("INDX")) while (esm.isNextSub("INDX"))
{ {
PartReference pr; PartReference pr;

@ -9,6 +9,7 @@ namespace ESM
void InventoryList::load(ESMReader &esm) void InventoryList::load(ESMReader &esm)
{ {
mList.clear();
ContItem ci; ContItem ci;
while (esm.isNextSub("NPCO")) while (esm.isNextSub("NPCO"))
{ {

@ -51,6 +51,7 @@ void NPC::load(ESMReader &esm)
else else
mHasAI = false; mHasAI = false;
mTransport.clear();
while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) { while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) {
if (esm.retSubName() == 0x54444f44) { // DODT struct if (esm.retSubName() == 0x54444f44) { // DODT struct
Dest dodt; Dest dodt;

@ -27,6 +27,9 @@ void Pathgrid::load(ESMReader &esm)
esm.getHNT(mData, "DATA", 12); esm.getHNT(mData, "DATA", 12);
mCell = esm.getHNString("NAME"); mCell = esm.getHNString("NAME");
mPoints.clear();
mEdges.clear();
// keep track of total connections so we can reserve edge vector size // keep track of total connections so we can reserve edge vector size
int edgeCount = 0; int edgeCount = 0;

@ -39,6 +39,7 @@ void Region::load(ESMReader &esm)
esm.getHNT(mMapColor, "CNAM"); esm.getHNT(mMapColor, "CNAM");
mSoundList.clear();
while (esm.hasMoreSubs()) while (esm.hasMoreSubs())
{ {
SoundRef sr; SoundRef sr;

@ -22,6 +22,8 @@ void Script::load(ESMReader &esm)
mData = data.mData; mData = data.mData;
mId = data.mName.toString(); mId = data.mName.toString();
mVarNames.clear();
// List of local variables // List of local variables
if (esm.isNextSub("SCVR")) if (esm.isNextSub("SCVR"))
{ {

@ -7,6 +7,7 @@ namespace ESM {
void SpellList::load(ESMReader &esm) void SpellList::load(ESMReader &esm)
{ {
mList.clear();
while (esm.isNextSub("NPCS")) { while (esm.isNextSub("NPCS")) {
mList.push_back(esm.getHString()); mList.push_back(esm.getHString());
} }

Loading…
Cancel
Save