mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 19:36:43 +00:00
prevent duplicate journal entries from being recorded
This commit is contained in:
parent
528c3da6da
commit
4c7ae3d1ff
1 changed files with 6 additions and 0 deletions
|
@ -31,6 +31,12 @@ namespace MWDialogue
|
||||||
|
|
||||||
void Journal::addEntry (const std::string& id, int index)
|
void Journal::addEntry (const std::string& id, int index)
|
||||||
{
|
{
|
||||||
|
// bail out of we already have heard this...
|
||||||
|
auto infoId = JournalEntry::idFromIndex (id, index);
|
||||||
|
for (auto i = mJournal.begin (); i != mJournal.end (); ++i)
|
||||||
|
if (i->mTopic == id && i->mInfoId == infoId)
|
||||||
|
return;
|
||||||
|
|
||||||
StampedJournalEntry entry = StampedJournalEntry::makeFromQuest (id, index);
|
StampedJournalEntry entry = StampedJournalEntry::makeFromQuest (id, index);
|
||||||
|
|
||||||
mJournal.push_back (entry);
|
mJournal.push_back (entry);
|
||||||
|
|
Loading…
Reference in a new issue