forked from mirror/openmw-tes3mp
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;
|
return mExtEnd;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
|
||||||
class Store<ESM::Script>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
} //end namespace
|
} //end namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,9 +6,18 @@
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
|
|
||||||
|
struct SCHD
|
||||||
|
{
|
||||||
|
NAME32 mName;
|
||||||
|
SCHDstruct mData;
|
||||||
|
};
|
||||||
|
|
||||||
void Script::load(ESMReader &esm)
|
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
|
// List of local variables
|
||||||
if (esm.isNextSub("SCVR"))
|
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)
|
for (std::vector<std::string>::iterator it = mVarNames.begin(); it != mVarNames.end(); ++it)
|
||||||
varNameString.append(*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())
|
if (!mVarNames.empty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,13 +42,13 @@ public:
|
||||||
approach though.
|
approach though.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NAME32 mName;
|
|
||||||
|
|
||||||
// These describe the sizes we need to allocate for the script
|
// These describe the sizes we need to allocate for the script
|
||||||
// data.
|
// data.
|
||||||
int mNumShorts, mNumLongs, mNumFloats, mScriptDataSize, mStringTableSize;
|
int mNumShorts, mNumLongs, mNumFloats, mScriptDataSize, mStringTableSize;
|
||||||
}; // 52 bytes
|
}; // 52 bytes
|
||||||
|
|
||||||
|
std::string mId;
|
||||||
|
|
||||||
SCHDstruct mData;
|
SCHDstruct mData;
|
||||||
|
|
||||||
std::vector<std::string> mVarNames; // Variable names
|
std::vector<std::string> mVarNames; // Variable names
|
||||||
|
|
Loading…
Reference in a new issue