mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-13 15:09:43 +00:00
alter ESM::Script for storing id as std::string
This commit is contained in:
parent
f0ecbbb056
commit
5ac54d1fff
3 changed files with 19 additions and 10 deletions
|
@ -676,12 +676,6 @@ namespace MWWorld
|
|||
return mExtEnd;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class Store<ESM::Script>
|
||||
{
|
||||
};
|
||||
|
||||
} //end namespace
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,9 +6,18 @@
|
|||
namespace ESM
|
||||
{
|
||||
|
||||
struct SCHD
|
||||
{
|
||||
NAME32 mName;
|
||||
SCHDstruct mData;
|
||||
};
|
||||
|
||||
void Script::load(ESMReader &esm)
|
||||
{
|
||||
esm.getHNT(mData, "SCHD", 52);
|
||||
SCHD data;
|
||||
esm.getHNT(data, "SCHD", 52);
|
||||
mData = data.mData;
|
||||
mId = data.mName.toString();
|
||||
|
||||
// List of local variables
|
||||
if (esm.isNextSub("SCVR"))
|
||||
|
@ -48,7 +57,13 @@ void Script::save(ESMWriter &esm)
|
|||
for (std::vector<std::string>::iterator it = mVarNames.begin(); it != mVarNames.end(); ++it)
|
||||
varNameString.append(*it);
|
||||
|
||||
esm.writeHNT("SCHD", mData, 52);
|
||||
SCHD data;
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
data.mData = mData;
|
||||
memcpy(data.mName.name, mId.c_str(), mId.size());
|
||||
|
||||
esm.writeHNT("SCHD", data, 52);
|
||||
|
||||
if (!mVarNames.empty())
|
||||
{
|
||||
|
|
|
@ -42,13 +42,13 @@ public:
|
|||
approach though.
|
||||
*/
|
||||
|
||||
NAME32 mName;
|
||||
|
||||
// These describe the sizes we need to allocate for the script
|
||||
// data.
|
||||
int mNumShorts, mNumLongs, mNumFloats, mScriptDataSize, mStringTableSize;
|
||||
}; // 52 bytes
|
||||
|
||||
std::string mId;
|
||||
|
||||
SCHDstruct mData;
|
||||
|
||||
std::vector<std::string> mVarNames; // Variable names
|
||||
|
|
Loading…
Reference in a new issue