|
|
|
@ -31,33 +31,41 @@ void CellStore::loadRefs(const Cell &cell, const ESMStore &store, ESMReader &esm
|
|
|
|
|
// Get each reference in turn
|
|
|
|
|
while(cell.getNextRef(esm, ref))
|
|
|
|
|
{
|
|
|
|
|
cout << "Reference: " << ref.refID;
|
|
|
|
|
|
|
|
|
|
// Check each list in turn. Potential for optimization.
|
|
|
|
|
if(
|
|
|
|
|
activators .find(ref, store.activators) &&
|
|
|
|
|
potions .find(ref, store.potions) &&
|
|
|
|
|
appas .find(ref, store.appas) &&
|
|
|
|
|
armors .find(ref, store.armors) &&
|
|
|
|
|
books .find(ref, store.books) &&
|
|
|
|
|
clothes .find(ref, store.clothes) &&
|
|
|
|
|
containers .find(ref, store.containers) &&
|
|
|
|
|
creatures .find(ref, store.creatures) &&
|
|
|
|
|
doors .find(ref, store.doors) &&
|
|
|
|
|
ingreds .find(ref, store.ingreds) &&
|
|
|
|
|
creatureLists .find(ref, store.creatureLists) &&
|
|
|
|
|
itemLists .find(ref, store.itemLists) &&
|
|
|
|
|
lights .find(ref, store.lights) &&
|
|
|
|
|
lockpicks .find(ref, store.lockpicks) &&
|
|
|
|
|
miscItems .find(ref, store.miscItems) &&
|
|
|
|
|
npcs .find(ref, store.npcs) &&
|
|
|
|
|
probes .find(ref, store.probes) &&
|
|
|
|
|
repairs .find(ref, store.repairs) &&
|
|
|
|
|
statics .find(ref, store.statics) &&
|
|
|
|
|
weapons .find(ref, store.weapons)
|
|
|
|
|
|
|
|
|
|
) cout << " (NOT FOUND)";
|
|
|
|
|
|
|
|
|
|
cout << endl;
|
|
|
|
|
int rec = store.find(ref.refID);
|
|
|
|
|
|
|
|
|
|
/* We can optimize this further by storing the pointer to the
|
|
|
|
|
record itself in store.all, so that we don't need to look it
|
|
|
|
|
up again here. However, never optimize. There are infinite
|
|
|
|
|
opportunities to do that later.
|
|
|
|
|
*/
|
|
|
|
|
switch(rec)
|
|
|
|
|
{
|
|
|
|
|
case REC_ACTI: activators.find(ref, store.activators); break;
|
|
|
|
|
case REC_ALCH: potions.find(ref, store.potions); break;
|
|
|
|
|
case REC_APPA: appas.find(ref, store.appas); break;
|
|
|
|
|
case REC_ARMO: armors.find(ref, store.armors); break;
|
|
|
|
|
case REC_BOOK: books.find(ref, store.books); break;
|
|
|
|
|
case REC_CLOT: clothes.find(ref, store.clothes); break;
|
|
|
|
|
case REC_CONT: containers.find(ref, store.containers); break;
|
|
|
|
|
case REC_CREA: creatures.find(ref, store.creatures); break;
|
|
|
|
|
case REC_DOOR: doors.find(ref, store.doors); break;
|
|
|
|
|
case REC_INGR: ingreds.find(ref, store.ingreds); break;
|
|
|
|
|
case REC_LEVC: creatureLists.find(ref, store.creatureLists); break;
|
|
|
|
|
case REC_LEVI: itemLists.find(ref, store.itemLists); break;
|
|
|
|
|
case REC_LIGH: lights.find(ref, store.lights); break;
|
|
|
|
|
case REC_LOCK: lockpicks.find(ref, store.lockpicks); break;
|
|
|
|
|
case REC_MISC: miscItems.find(ref, store.miscItems); break;
|
|
|
|
|
case REC_NPC_: npcs.find(ref, store.npcs); break;
|
|
|
|
|
case REC_PROB: probes.find(ref, store.probes); break;
|
|
|
|
|
case REC_REPA: repairs.find(ref, store.repairs); break;
|
|
|
|
|
case REC_STAT: statics.find(ref, store.statics); break;
|
|
|
|
|
case REC_WEAP: weapons.find(ref, store.weapons); break;
|
|
|
|
|
|
|
|
|
|
case 0: cout << "Cell reference " + ref.refID + " not found!\n"; break;
|
|
|
|
|
default:
|
|
|
|
|
assert(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cout << "Statics in cell: " << statics.list.size() << endl;
|
|
|
|
|
}
|
|
|
|
|