diff --git a/SKSE/Plugins/ArtifactTracker.dll b/SKSE/Plugins/ArtifactTracker.dll index 07b58d3..36bafec 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 1b36612..a002c46 100644 --- a/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp +++ b/Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp @@ -418,7 +418,7 @@ namespace ArtifactTracker } // NB: During OnContainerChanged, InventoryChanges do not have the current change included yet - if ((GetItemCount(RE::PlayerCharacter::GetSingleton(), form->formID) - a_event->itemCount <= 0) && GetFollowerItemCount(form->formID) <= 0) { + if ((GetItemCount(RE::PlayerCharacter::GetSingleton(), form->formID) - a_event->itemCount <= 0) && !FollowersHaveItem(form->formID)) { ListRemoveItem(g_listFound, form); ListRemoveItem(g_listNew, form); g_listNew->AddForm(form); @@ -457,7 +457,7 @@ namespace ArtifactTracker } // NB: During OnContainerChanged, InventoryChanges do not have the current change included yet - } else if (g_listFound->HasForm(form) && (GetItemCount(RE::PlayerCharacter::GetSingleton(), form->formID) - a_event->itemCount <= 0) && GetFollowerItemCount(form->formID) <= 0) { + } else if (g_listFound->HasForm(form) && (GetItemCount(RE::PlayerCharacter::GetSingleton(), form->formID) - a_event->itemCount <= 0) && !FollowersHaveItem(form->formID)) { ListRemoveItem(g_listFound, form); g_listNew->AddForm(form); } diff --git a/Source/ArtifactTrackerDLL/src/Util.h b/Source/ArtifactTrackerDLL/src/Util.h index a875a9f..a722b83 100644 --- a/Source/ArtifactTrackerDLL/src/Util.h +++ b/Source/ArtifactTrackerDLL/src/Util.h @@ -72,19 +72,19 @@ inline bool RefHasItem(RE::TESForm* a_refOrList, RE::FormID a_formID) return false; } -inline std::uint32_t GetFollowerItemCount(RE::FormID a_formID) +inline bool FollowersHaveItem(RE::FormID a_formID) { - std::int32_t iResult = 0; - if (const auto processLists = RE::ProcessLists::GetSingleton(); processLists) { for (auto& actorHandle : processLists->highActorHandles) { if (auto actor = actorHandle.get(); actor && actor->IsPlayerTeammate()) { - iResult += GetItemCount(actor->As(), a_formID); + if (GetItemCount(actor->As(), a_formID) > 0) { + return true; + } } } } - return iResult; + return false; }