|
|
@ -332,7 +332,7 @@ namespace ArtifactTracker |
|
|
|
const auto& [count, entry] = data; |
|
|
|
const auto& [count, entry] = data; |
|
|
|
if (count > 0 && !cellItems.contains(item->formID)) { |
|
|
|
if (count > 0 && !cellItems.contains(item->formID)) { |
|
|
|
g_cellStorage->RemoveItem(item, count, RE::ITEM_REMOVE_REASON::kRemove, nullptr, nullptr); |
|
|
|
g_cellStorage->RemoveItem(item, count, RE::ITEM_REMOVE_REASON::kRemove, nullptr, nullptr); |
|
|
|
if (!RefHasItem(g_persistentStorage, item->formID)) { |
|
|
|
if (!RefListHasItem(g_persistentStorage, item->formID)) { |
|
|
|
ListRemoveItem(g_listStored, item); |
|
|
|
ListRemoveItem(g_listStored, item); |
|
|
|
g_listFound->AddForm(item); |
|
|
|
g_listFound->AddForm(item); |
|
|
|
} |
|
|
|
} |
|
|
@ -351,7 +351,7 @@ namespace ArtifactTracker |
|
|
|
if (g_persistentMap.contains(a_event->oldContainer)) { |
|
|
|
if (g_persistentMap.contains(a_event->oldContainer)) { |
|
|
|
|
|
|
|
|
|
|
|
// Items in persistent containers are marked as stored by definition, no need to check the list
|
|
|
|
// Items in persistent containers are marked as stored by definition, no need to check the list
|
|
|
|
if (!RefHasItem(g_persistentStorage, a_event->baseObj)) { |
|
|
|
if (!RefListHasItem(g_persistentStorage, a_event->baseObj)) { |
|
|
|
ListRemoveItem(g_listStored, form); |
|
|
|
ListRemoveItem(g_listStored, form); |
|
|
|
g_listFound->AddForm(form); |
|
|
|
g_listFound->AddForm(form); |
|
|
|
} |
|
|
|
} |
|
|
@ -400,7 +400,7 @@ namespace ArtifactTracker |
|
|
|
if (!a_event->newContainer) { // no destination container
|
|
|
|
if (!a_event->newContainer) { // no destination container
|
|
|
|
|
|
|
|
|
|
|
|
if (g_cellStorage && a_event->reference) { // dropped or placed on rack at home
|
|
|
|
if (g_cellStorage && a_event->reference) { // dropped or placed on rack at home
|
|
|
|
if (!RefHasItem(g_cellStorage, form->formID)) { |
|
|
|
if (GetItemCount(g_cellStorage, form) <= 0) { |
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
SKSE::log::info("Added dropped {} to cell storage", form->GetName()); |
|
|
|
SKSE::log::info("Added dropped {} to cell storage", form->GetName()); |
|
|
|
RE::DebugNotification("Adding to cell storage"); |
|
|
|
RE::DebugNotification("Adding to cell storage"); |
|
|
@ -418,7 +418,7 @@ namespace ArtifactTracker |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NB: During OnContainerChanged, InventoryChanges do not have the current change included yet
|
|
|
|
// NB: During OnContainerChanged, InventoryChanges do not have the current change included yet
|
|
|
|
if ((GetItemCount(RE::PlayerCharacter::GetSingleton(), form->formID) - a_event->itemCount <= 0) && !FollowersHaveItem(form->formID)) { |
|
|
|
if ((GetItemCount(RE::PlayerCharacter::GetSingleton(), form->formID) - a_event->itemCount <= 0) && !FollowersHaveItem(form)) { |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
ListRemoveItem(g_listNew, form); |
|
|
|
ListRemoveItem(g_listNew, form); |
|
|
|
g_listNew->AddForm(form); |
|
|
|
g_listNew->AddForm(form); |
|
|
@ -446,7 +446,7 @@ namespace ArtifactTracker |
|
|
|
const auto targetContainer = RE::TESForm::LookupByID<RE::TESObjectREFR>(a_event->newContainer); |
|
|
|
const auto targetContainer = RE::TESForm::LookupByID<RE::TESObjectREFR>(a_event->newContainer); |
|
|
|
|
|
|
|
|
|
|
|
if (IsValidContainer(targetContainer)) { |
|
|
|
if (IsValidContainer(targetContainer)) { |
|
|
|
if (!RefHasItem(g_cellStorage, form->formID)) { |
|
|
|
if (GetItemCount(g_cellStorage, form) <= 0) { |
|
|
|
g_cellStorage->AddObjectToContainer(form->As<RE::TESBoundObject>(), nullptr, 1, nullptr); |
|
|
|
g_cellStorage->AddObjectToContainer(form->As<RE::TESBoundObject>(), nullptr, 1, nullptr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -457,7 +457,7 @@ namespace ArtifactTracker |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NB: During OnContainerChanged, InventoryChanges do not have the current change included yet
|
|
|
|
// 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) && !FollowersHaveItem(form->formID)) { |
|
|
|
} else if (g_listFound->HasForm(form) && (GetItemCount(RE::PlayerCharacter::GetSingleton(), form->formID) - a_event->itemCount <= 0) && !FollowersHaveItem(form)) { |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
g_listNew->AddForm(form); |
|
|
|
g_listNew->AddForm(form); |
|
|
|
} |
|
|
|
} |
|
|
|