From 0bc13b47fac6f25e7be190fd3c2be4c6d1c414c5 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Thu, 5 Dec 2019 23:42:12 +0300 Subject: [PATCH] Fix essimporter script header and inventory item conversion --- apps/essimporter/convertscpt.cpp | 2 +- apps/essimporter/importinventory.cpp | 4 ++-- apps/essimporter/importinventory.hpp | 8 ++++++++ apps/essimporter/importscpt.hpp | 8 +++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/essimporter/convertscpt.cpp b/apps/essimporter/convertscpt.cpp index 484a2782a..ca81ebbbf 100644 --- a/apps/essimporter/convertscpt.cpp +++ b/apps/essimporter/convertscpt.cpp @@ -9,7 +9,7 @@ namespace ESSImport 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; convertSCRI(scpt.mSCRI, out.mLocals); } diff --git a/apps/essimporter/importinventory.cpp b/apps/essimporter/importinventory.cpp index 177213a13..cff114acb 100644 --- a/apps/essimporter/importinventory.cpp +++ b/apps/essimporter/importinventory.cpp @@ -13,11 +13,11 @@ namespace ESSImport { while (esm.isNextSub("NPCO")) { - ESM::ContItem contItem; + ContItem contItem; esm.getHT(contItem); InventoryItem item; - item.mId = contItem.mItem; + item.mId = contItem.mItem.toString(); item.mCount = contItem.mCount; item.mRelativeEquipmentSlot = -1; item.mLockLevel = 0; diff --git a/apps/essimporter/importinventory.hpp b/apps/essimporter/importinventory.hpp index 0b5405d96..a1324a696 100644 --- a/apps/essimporter/importinventory.hpp +++ b/apps/essimporter/importinventory.hpp @@ -5,6 +5,8 @@ #include #include +#include + #include "importscri.hpp" namespace ESM @@ -15,6 +17,12 @@ namespace ESM namespace ESSImport { + struct ContItem + { + int mCount; + ESM::NAME32 mItem; + }; + struct Inventory { struct InventoryItem : public ESM::CellRef diff --git a/apps/essimporter/importscpt.hpp b/apps/essimporter/importscpt.hpp index ce54c3a73..6bfd2603a 100644 --- a/apps/essimporter/importscpt.hpp +++ b/apps/essimporter/importscpt.hpp @@ -13,10 +13,16 @@ namespace ESM namespace ESSImport { + struct SCHD + { + ESM::NAME32 mName; + ESM::Script::SCHDstruct mData; + }; + // A running global script struct SCPT { - ESM::Script::SCHD mSCHD; + SCHD mSCHD; // values of local variables SCRI mSCRI;