Fix essimporter script header and inventory item conversion

pull/2627/head
Capostrophic 5 years ago
parent 43330f1dd1
commit 0bc13b47fa

@ -9,7 +9,7 @@ namespace ESSImport
void convertSCPT(const SCPT &scpt, ESM::GlobalScript &out) void convertSCPT(const SCPT &scpt, ESM::GlobalScript &out)
{ {
out.mId = Misc::StringUtils::lowerCase(scpt.mSCHD.mName); out.mId = Misc::StringUtils::lowerCase(scpt.mSCHD.mName.toString());
out.mRunning = scpt.mRunning; out.mRunning = scpt.mRunning;
convertSCRI(scpt.mSCRI, out.mLocals); convertSCRI(scpt.mSCRI, out.mLocals);
} }

@ -13,11 +13,11 @@ namespace ESSImport
{ {
while (esm.isNextSub("NPCO")) while (esm.isNextSub("NPCO"))
{ {
ESM::ContItem contItem; ContItem contItem;
esm.getHT(contItem); esm.getHT(contItem);
InventoryItem item; InventoryItem item;
item.mId = contItem.mItem; item.mId = contItem.mItem.toString();
item.mCount = contItem.mCount; item.mCount = contItem.mCount;
item.mRelativeEquipmentSlot = -1; item.mRelativeEquipmentSlot = -1;
item.mLockLevel = 0; item.mLockLevel = 0;

@ -5,6 +5,8 @@
#include <string> #include <string>
#include <components/esm/cellref.hpp> #include <components/esm/cellref.hpp>
#include <components/esm/esmcommon.hpp>
#include "importscri.hpp" #include "importscri.hpp"
namespace ESM namespace ESM
@ -15,6 +17,12 @@ namespace ESM
namespace ESSImport namespace ESSImport
{ {
struct ContItem
{
int mCount;
ESM::NAME32 mItem;
};
struct Inventory struct Inventory
{ {
struct InventoryItem : public ESM::CellRef struct InventoryItem : public ESM::CellRef

@ -13,10 +13,16 @@ namespace ESM
namespace ESSImport namespace ESSImport
{ {
struct SCHD
{
ESM::NAME32 mName;
ESM::Script::SCHDstruct mData;
};
// A running global script // A running global script
struct SCPT struct SCPT
{ {
ESM::Script::SCHD mSCHD; SCHD mSCHD;
// values of local variables // values of local variables
SCRI mSCRI; SCRI mSCRI;

Loading…
Cancel
Save