mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-22 08:39:41 +00:00
read info records
This commit is contained in:
parent
10a63b10b5
commit
d47de55ce9
2 changed files with 55 additions and 19 deletions
|
@ -14,13 +14,13 @@
|
||||||
#include "loadcont.hpp"
|
#include "loadcont.hpp"
|
||||||
#include "loadcrea.hpp"
|
#include "loadcrea.hpp"
|
||||||
#include "loadcrec.hpp"
|
#include "loadcrec.hpp"
|
||||||
|
#include "loadinfo.hpp"
|
||||||
#include "loaddial.hpp"
|
#include "loaddial.hpp"
|
||||||
#include "loaddoor.hpp"
|
#include "loaddoor.hpp"
|
||||||
#include "loadench.hpp"
|
#include "loadench.hpp"
|
||||||
#include "loadfact.hpp"
|
#include "loadfact.hpp"
|
||||||
#include "loadglob.hpp"
|
#include "loadglob.hpp"
|
||||||
#include "loadgmst.hpp"
|
#include "loadgmst.hpp"
|
||||||
#include "loadinfo.hpp"
|
|
||||||
#include "loadingr.hpp"
|
#include "loadingr.hpp"
|
||||||
#include "loadland.hpp"
|
#include "loadland.hpp"
|
||||||
#include "loadlevlist.hpp"
|
#include "loadlevlist.hpp"
|
||||||
|
|
|
@ -20,6 +20,8 @@ void ESMStore::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
set<string> missing;
|
set<string> missing;
|
||||||
|
|
||||||
|
ESM::Dialogue *dialogue = 0;
|
||||||
|
|
||||||
// Loop through all records
|
// Loop through all records
|
||||||
while(esm.hasMoreRecs())
|
while(esm.hasMoreRecs())
|
||||||
{
|
{
|
||||||
|
@ -30,21 +32,55 @@ void ESMStore::load(ESMReader &esm)
|
||||||
RecListList::iterator it = recLists.find(n.val);
|
RecListList::iterator it = recLists.find(n.val);
|
||||||
|
|
||||||
if(it == recLists.end())
|
if(it == recLists.end())
|
||||||
|
{
|
||||||
|
if (n.val==ESM::REC_INFO)
|
||||||
|
{
|
||||||
|
if (dialogue)
|
||||||
|
{
|
||||||
|
ESM::DialInfo info;
|
||||||
|
info.load (esm);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << "error: info record without dialog" << std::endl;
|
||||||
|
esm.skipRecord();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Not found (this would be an error later)
|
// Not found (this would be an error later)
|
||||||
esm.skipRecord();
|
esm.skipRecord();
|
||||||
missing.insert(n.toString());
|
missing.insert(n.toString());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Load it
|
// Load it
|
||||||
std::string id = esm.getHNOString("NAME");
|
std::string id = esm.getHNOString("NAME");
|
||||||
it->second->load(esm, id);
|
it->second->load(esm, id);
|
||||||
|
|
||||||
|
if (n.val==ESM::REC_DIAL)
|
||||||
|
{
|
||||||
|
RecListT<Dialogue>& recList = static_cast<RecListT<Dialogue>& > (*it->second);
|
||||||
|
|
||||||
|
id = recList.toLower (id);
|
||||||
|
|
||||||
|
RecListT<Dialogue>::MapType::iterator iter = recList.list.find (id);
|
||||||
|
|
||||||
|
assert (iter!=recList.list.end());
|
||||||
|
|
||||||
|
dialogue = &iter->second;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dialogue = 0;
|
||||||
|
|
||||||
// Insert the reference into the global lookup
|
// Insert the reference into the global lookup
|
||||||
if(!id.empty())
|
if(!id.empty())
|
||||||
all[id] = n.val;
|
all[id] = n.val;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* This information isn't needed on screen. But keep the code around
|
/* This information isn't needed on screen. But keep the code around
|
||||||
for debugging purposes later.
|
for debugging purposes later.
|
||||||
|
|
Loading…
Reference in a new issue