mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Fix mIds mapping for dynamic records being lost on save/reload
This commit is contained in:
parent
928b9ee41b
commit
d31ae2b345
2 changed files with 12 additions and 4 deletions
|
@ -192,7 +192,15 @@ void ESMStore::setUp()
|
||||||
case ESM::REC_LEVI:
|
case ESM::REC_LEVI:
|
||||||
case ESM::REC_LEVC:
|
case ESM::REC_LEVC:
|
||||||
|
|
||||||
mStores[type]->read (reader);
|
{
|
||||||
|
std::string id = reader.getHNString ("NAME");
|
||||||
|
mStores[type]->read (reader, id);
|
||||||
|
|
||||||
|
// FIXME: there might be stale dynamic IDs in mIds from an earlier savegame
|
||||||
|
// that really should be cleared instead of just overwritten
|
||||||
|
|
||||||
|
mIds[id] = type;
|
||||||
|
}
|
||||||
|
|
||||||
if (type==ESM::REC_NPC_)
|
if (type==ESM::REC_NPC_)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace MWWorld
|
||||||
|
|
||||||
virtual void write (ESM::ESMWriter& writer) const {}
|
virtual void write (ESM::ESMWriter& writer) const {}
|
||||||
|
|
||||||
virtual void read (ESM::ESMReader& reader) {}
|
virtual void read (ESM::ESMReader& reader, const std::string& id) {}
|
||||||
///< Read into dynamic storage
|
///< Read into dynamic storage
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -329,10 +329,10 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void read (ESM::ESMReader& reader)
|
void read (ESM::ESMReader& reader, const std::string& id)
|
||||||
{
|
{
|
||||||
T record;
|
T record;
|
||||||
record.mId = reader.getHNString ("NAME");
|
record.mId = id;
|
||||||
record.load (reader);
|
record.load (reader);
|
||||||
insert (record);
|
insert (record);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue