mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 12:39:53 +00:00
cleaned up ID handling in INFO record (including a ESMTool bug fix)
This commit is contained in:
parent
9d7695ea88
commit
2d4a6c0edf
@ -339,6 +339,8 @@ int load(Arguments& info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string id = esm.getHNOString("NAME");
|
std::string id = esm.getHNOString("NAME");
|
||||||
|
if (id.empty())
|
||||||
|
id = esm.getHNOString("INAM");
|
||||||
|
|
||||||
if(!quiet && interested)
|
if(!quiet && interested)
|
||||||
std::cout << "\nRecord: " << n.toString()
|
std::cout << "\nRecord: " << n.toString()
|
||||||
|
@ -35,7 +35,7 @@ void CSMWorld::InfoCollection::load (ESM::ESMReader& reader, bool base, const ES
|
|||||||
{
|
{
|
||||||
/// \todo put records into proper order
|
/// \todo put records into proper order
|
||||||
/// \todo adjust ID
|
/// \todo adjust ID
|
||||||
std::string id = reader.getHNOString ("NAME");
|
std::string id = reader.getHNOString ("INAM");
|
||||||
|
|
||||||
if (reader.isNextSub ("DELE"))
|
if (reader.isNextSub ("DELE"))
|
||||||
{
|
{
|
||||||
|
@ -70,8 +70,10 @@ void ESMStore::load(ESM::ESMReader &esm, Loading::Listener* listener)
|
|||||||
|
|
||||||
if (it == mStores.end()) {
|
if (it == mStores.end()) {
|
||||||
if (n.val == ESM::REC_INFO) {
|
if (n.val == ESM::REC_INFO) {
|
||||||
|
std::string id = esm.getHNOString("INAM");
|
||||||
if (dialogue) {
|
if (dialogue) {
|
||||||
dialogue->mInfo.push_back(ESM::DialInfo());
|
dialogue->mInfo.push_back(ESM::DialInfo());
|
||||||
|
dialogue->mInfo.back().mId = id;
|
||||||
dialogue->mInfo.back().load(esm);
|
dialogue->mInfo.back().load(esm);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "error: info record without dialog" << std::endl;
|
std::cerr << "error: info record without dialog" << std::endl;
|
||||||
|
@ -258,7 +258,7 @@ namespace MWWorld
|
|||||||
typename std::vector<T *>::iterator sharedIter = mShared.begin();
|
typename std::vector<T *>::iterator sharedIter = mShared.begin();
|
||||||
typename std::vector<T *>::iterator end = sharedIter + mStatic.size();
|
typename std::vector<T *>::iterator end = sharedIter + mStatic.size();
|
||||||
|
|
||||||
while (sharedIter != mShared.end() && sharedIter != end) {
|
while (sharedIter != mShared.end() && sharedIter != end) {
|
||||||
if((*sharedIter)->mId == item.mId) {
|
if((*sharedIter)->mId == item.mId) {
|
||||||
mShared.erase(sharedIter);
|
mShared.erase(sharedIter);
|
||||||
break;
|
break;
|
||||||
|
@ -8,7 +8,6 @@ namespace ESM
|
|||||||
|
|
||||||
void DialInfo::load(ESMReader &esm)
|
void DialInfo::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
mId = esm.getHNString("INAM");
|
|
||||||
mPrev = esm.getHNString("PNAM");
|
mPrev = esm.getHNString("PNAM");
|
||||||
mNext = esm.getHNString("NNAM");
|
mNext = esm.getHNString("NNAM");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user