Fix NameDB and Voice related crashes

This commit is contained in:
2018-09-01 20:45:46 -07:00
parent 1884e0ca7a
commit d9018e2d2e
3 changed files with 13 additions and 7 deletions

View File

@@ -51,7 +51,8 @@ AudioGroupSampleDirectory::AudioGroupSampleDirectory(athena::io::IStreamReader&
EntryDNA<athena::Big> ent;
ent.read(r);
m_entries[ent.m_sfxId] = MakeObj<Entry>(ent);
SampleId::CurNameDB->registerPair(NameDB::generateName(ent.m_sfxId, NameDB::Type::Sample), ent.m_sfxId);
if (SampleId::CurNameDB)
SampleId::CurNameDB->registerPair(NameDB::generateName(ent.m_sfxId, NameDB::Type::Sample), ent.m_sfxId);
}
for (auto& p : m_entries)