|
|
|
@ -21,13 +21,18 @@ namespace ESSImport
|
|
|
|
|
item.mCount = contItem.mCount;
|
|
|
|
|
item.mRelativeEquipmentSlot = -1;
|
|
|
|
|
|
|
|
|
|
// seems that a stack of items can have a set of subrecords for each item? rings0000.ess
|
|
|
|
|
// doesn't make any sense to me, if the values were different then the items shouldn't stack in the first place?
|
|
|
|
|
// I guess we should double check the stacking logic in OpenMW
|
|
|
|
|
for (int i=0;i<std::abs(item.mCount);++i)
|
|
|
|
|
unsigned int itemCount = std::abs(item.mCount);
|
|
|
|
|
bool separateStacks = false;
|
|
|
|
|
for (unsigned int i=0;i<itemCount;++i)
|
|
|
|
|
{
|
|
|
|
|
if (esm.isNextSub("XIDX")) // index in the stack?
|
|
|
|
|
esm.skipHSub();
|
|
|
|
|
bool newStack = esm.isNextSub("XIDX");
|
|
|
|
|
if (newStack)
|
|
|
|
|
{
|
|
|
|
|
unsigned int idx;
|
|
|
|
|
esm.getHT(idx);
|
|
|
|
|
separateStacks = true;
|
|
|
|
|
item.mCount = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item.mSCRI.load(esm);
|
|
|
|
|
|
|
|
|
@ -38,8 +43,12 @@ namespace ESSImport
|
|
|
|
|
int charge=-1;
|
|
|
|
|
esm.getHNOT(charge, "XHLT");
|
|
|
|
|
item.mChargeInt = charge;
|
|
|
|
|
|
|
|
|
|
if (newStack)
|
|
|
|
|
mItems.push_back(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!separateStacks)
|
|
|
|
|
mItems.push_back(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|