|
|
@ -186,7 +186,7 @@ namespace ArtifactTracker |
|
|
|
RE::TESObjectCELL* cell = RE::TESForm::LookupByID<RE::TESObjectCELL>(a_formID); |
|
|
|
RE::TESObjectCELL* cell = RE::TESForm::LookupByID<RE::TESObjectCELL>(a_formID); |
|
|
|
RE::BGSLocation* location = cell ? cell->GetLocation() : nullptr; |
|
|
|
RE::BGSLocation* location = cell ? cell->GetLocation() : nullptr; |
|
|
|
|
|
|
|
|
|
|
|
if (!cell || !cell->IsInteriorCell() || !location || !location->HasKeyword(g_homeKeyword)) { |
|
|
|
if (!cell || !location || !cell->IsInteriorCell() || !location->HasKeyword(g_homeKeyword)) { |
|
|
|
if (IsHome()) { |
|
|
|
if (IsHome()) { |
|
|
|
RE::ScriptEventSourceHolder::GetSingleton()->RemoveEventSink<RE::TESCellFullyLoadedEvent>(EventListener::GetSingleton()); |
|
|
|
RE::ScriptEventSourceHolder::GetSingleton()->RemoveEventSink<RE::TESCellFullyLoadedEvent>(EventListener::GetSingleton()); |
|
|
|
ToggleHomeMode(nullptr); |
|
|
|
ToggleHomeMode(nullptr); |
|
|
@ -373,16 +373,8 @@ namespace ArtifactTracker |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else if (g_cellStorage) { // probably, picked up at home (can also be crafted, but oh well)
|
|
|
|
} else if (g_cellStorage) { |
|
|
|
|
|
|
|
// Items picked up at home are handled in the perk
|
|
|
|
// OnContainerChanged fires before a picked item gets marked for deletion
|
|
|
|
|
|
|
|
const auto crosshairObj = RE::CrosshairPickData::GetSingleton()->target; |
|
|
|
|
|
|
|
if (crosshairObj && crosshairObj.get() && crosshairObj.get().get()->GetBaseObject()->formID == a_event->baseObj) { |
|
|
|
|
|
|
|
// Picked up items are handled in the perk
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SyncCellStorage(); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -425,7 +417,8 @@ namespace ArtifactTracker |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!RefHasItem(RE::PlayerCharacter::GetSingleton(), form->formID) && !FollowersHaveItem(form)) { |
|
|
|
// 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) { |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
ListRemoveItem(g_listNew, form); |
|
|
|
ListRemoveItem(g_listNew, form); |
|
|
|
g_listNew->AddForm(form); |
|
|
|
g_listNew->AddForm(form); |
|
|
@ -462,8 +455,9 @@ namespace ArtifactTracker |
|
|
|
g_listStored->AddForm(form); |
|
|
|
g_listStored->AddForm(form); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else if (g_listFound->HasForm(form) && !RefHasItem(RE::PlayerCharacter::GetSingleton(), form->formID) && !FollowersHaveItem(form)) { |
|
|
|
// 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) { |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
ListRemoveItem(g_listFound, form); |
|
|
|
g_listNew->AddForm(form); |
|
|
|
g_listNew->AddForm(form); |
|
|
|
} |
|
|
|
} |
|
|
|