diff --git a/Artifact Tracker.esp b/Artifact Tracker.esp index 7ef9724..cbd186a 100644 Binary files a/Artifact Tracker.esp and b/Artifact Tracker.esp differ diff --git a/SKSE/Plugins/ArtifactTracker.dll b/SKSE/Plugins/ArtifactTracker.dll index 7cc6d1a..4d05c60 100644 Binary files a/SKSE/Plugins/ArtifactTracker.dll and b/SKSE/Plugins/ArtifactTracker.dll differ diff --git a/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp b/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp index bf6c09d..5c29f8c 100644 --- a/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp +++ b/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp @@ -45,8 +45,8 @@ namespace ArtifactTracker const auto recipeKeyword = dataHandler->LookupForm(0xF5CB0, "Skyrim.esm"); // VendorItemRecipe const auto excludeKeywords = dataHandler->LookupForm(0x801, "Artifact Tracker.esp"); // ETR_ExcludeMiscKeywords - const auto extraArtifactKeyword = dataHandler->LookupForm(0xDE3FD3, "Update.esm"); // ETR_ExtraArtifact - const auto notArtifactKeyword = dataHandler->LookupForm(0xDE3FD4, "Update.esm"); // ETR_NotArtifact + const auto extraArtifactKeyword = dataHandler->LookupForm(0xAFC11A, "Update.esm"); // ETR_ExtraArtifact + const auto notArtifactKeyword = dataHandler->LookupForm(0xAFC11C, "Update.esm"); // ETR_NotArtifact const auto npcRaceKeyword = dataHandler->LookupForm(0x13794, "Skyrim.esm"); // ActorTypeNPC if (!g_cellContainer || !g_listNew || !g_listStored || !g_listFound || !g_persistentStorage || !g_homeKeyword || !recipeKeyword || !excludeKeywords || !extraArtifactKeyword || !notArtifactKeyword || !npcRaceKeyword) { @@ -57,7 +57,7 @@ namespace ArtifactTracker // Preloading item lists - std::map settings{ + std::map settings { { "DumpItemList", false }, }; LoadINI(&settings, "Data/SKSE/Plugins/ArtifactTracker.ini"); @@ -121,7 +121,7 @@ namespace ArtifactTracker } } - // Fishing CC (remove, when KID adds formlist support) + // Fishing CC (remove after KID receives formlist support) const auto plaqueFish = dataHandler->LookupForm(0xF4B, "ccBGSSSE001-Fish.esm"); // ccBGSSSE001_FishPlaqueGiftFilterList if (plaqueFish) { plaqueFish->ForEachForm([&](RE::TESForm& a_form) { @@ -414,7 +414,7 @@ namespace ArtifactTracker const auto ref = it->second; - if (ref && GetItemCount(ref, form) <= 0) { // no items left in the container + if (ref && !GetItemCount(ref, form)) { // no items left in the container for (const auto& persref : g_persistentMap) { if (persref.second != ref) { if (GetItemCount(persref.second, form)) { @@ -553,8 +553,9 @@ namespace ArtifactTracker const auto ref = RE::TESForm::LookupByID(a_event->oldContainer); if (ref->Is(RE::FormType::ActorCharacter)) { - if (ref->As()->IsPlayerTeammate() && GetItemCount(ref->As(), form) <= 0) { // removed from companion (probably, disarmed) - if (!g_listStored->HasForm(form) && g_listFound->HasForm(form)) { + const auto actor = ref->As(); + if (actor && actor->IsPlayerTeammate() && !GetItemCount(actor, form)) { // removed from companion (probably, disarmed) + if (g_listFound->HasForm(form)) { if (!GetItemCount(RE::PlayerCharacter::GetSingleton(), form)) { // player does not have it, check companions diff --git a/Source/ArtifactTrackerDLL/src/EventListener.cpp b/Source/ArtifactTrackerDLL/src/EventListener.cpp index f722091..8fe7fb0 100644 --- a/Source/ArtifactTrackerDLL/src/EventListener.cpp +++ b/Source/ArtifactTrackerDLL/src/EventListener.cpp @@ -19,7 +19,6 @@ auto EventListener::ProcessEvent( -> RE::BSEventNotifyControl { if (a_event->eventName == "KID_KeywordDistributionDone") { - SKSE::GetModCallbackEventSource()->RemoveEventSink(EventListener::GetSingleton()); ArtifactTracker::Init(); }