Skip to content

Commit

Permalink
feat: sync enchantments
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Feb 11, 2022
1 parent 1ade122 commit 1c9be42
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Code/client/Games/Skyrim/TESObjectREFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,18 @@ void TESObjectREFR::AddItem(const Container::Entry& arEntry) noexcept
// TODO: deal with temp forms for enchanted items
if (arEntry.ExtraEnchantId != 0)
{
spdlog::info("Enchanted");
TP_ASSERT(arEntry.ExtraEnchantId.ModId != 0xFFFFFFFF, "Enchantment is sent as temp!");

uint32_t enchantId = modSystem.GetGameId(arEntry.ExtraEnchantId);
if (EnchantmentItem* pEnchantment = RTTI_CAST(TESForm::GetById(enchantId), TESForm, EnchantmentItem))
{
ExtraEnchantment* pExtraEnchantment = Memory::Allocate<ExtraEnchantment>();
*((uint64_t*)pExtraEnchantment) = 0x141623E70;
pExtraEnchantment->next = nullptr;
pExtraEnchantment->pEnchantment = pEnchantment;
pExtraEnchantment->usCharge = arEntry.ExtraEnchantCharge;
pExtraEnchantment->bRemoveOnUnequip = arEntry.ExtraEnchantRemoveUnequip;
}
}

if (arEntry.ExtraHealth > 0.f)
Expand Down

0 comments on commit 1c9be42

Please sign in to comment.