From c1283010e89218bd601a5cc6bc30212a06e8165e Mon Sep 17 00:00:00 2001 From: Arkadii Hlushchevskyi Date: Sun, 7 Apr 2024 22:45:57 +0300 Subject: [PATCH] Fixed death distribution caused NPCs to unequip their equipment or outfit. --- SPID/src/Distribute.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/SPID/src/Distribute.cpp b/SPID/src/Distribute.cpp index 7ef6e96..23a68f6 100644 --- a/SPID/src/Distribute.cpp +++ b/SPID/src/Distribute.cpp @@ -7,13 +7,6 @@ namespace Distribute { namespace detail { - void add_item(RE::Actor* a_actor, RE::TESBoundObject* a_item, std::uint32_t a_itemCount) - { - using func_t = void (*)(RE::Actor*, RE::TESBoundObject*, std::uint32_t, bool, std::uint32_t, RE::BSScript::Internal::VirtualMachine*); - REL::Relocation func{ RELOCATION_ID(55945, 56489) }; - return func(a_actor, a_item, a_itemCount, true, 0, RE::BSScript::Internal::VirtualMachine::GetSingleton()); - } - /// /// Performs distribution of all configured forms to NPC described with npcData and input. /// @@ -161,11 +154,8 @@ namespace Distribute accumulatedForms); for_each_form( - npcData, forms.deathItems, input, [&](auto* deathItem, IndexOrCount idxOrCount) { - auto count = std::get(idxOrCount); - - detail::add_item(npcData.GetActor(), deathItem, count.GetRandom()); - return true; + npcData, forms.deathItems, input, [&](std::map& a_objects) { + return npc->AddObjectsToContainer(a_objects, npc); }, accumulatedForms); }