Use EquipItemEx to re-equip items after turning back from the werewolf form

This commit is contained in:
Eddoursul 2024-08-01 13:04:59 +02:00
parent 1081d60eec
commit b81e14aed9
3 changed files with 16 additions and 9 deletions

View File

@ -15,6 +15,7 @@ Beware, spoilers ahead!
-- Marking NPCs no longer happens solely by pointing, press "Activate" to mark an actor.
- Added the light attach crash fix by powerofthree.
- Fixed hightlighting of permanent effects in the hero menu (regression since 2.1).
- Fixed apparition talismans not recognized as equipped after turning back from the werewolf form.
2.1.1 (2024-04-24)

View File

@ -216,24 +216,25 @@ EndFunction
Function equipeItems()
Actor PlayerRef = Game.GetPlayer()
bool bSKSE = SKSE.GetVersion() as bool
if whatKindRight == 2
PlayerRef.EquipSpell(EquippedItemRight as Spell, 1)
elseif EquippedItemRight && PlayerRef.GetItemCount(EquippedItemRight) > 0
if SKSE.GetVersion()
if bSKSE
PlayerRef.EquipItemEx(EquippedItemRight, 1)
else
PlayerRef.equipitem(EquippedItemRight, false, true)
PlayerRef.EquipItem(EquippedItemRight, false, true)
endif
endif
if whatKindLeft == 2
PlayerRef.EquipSpell(EquippedItemLeft as Spell, 0)
elseif EquippedItemLeft && PlayerRef.GetItemCount(EquippedItemLeft) > 0
if SKSE.GetVersion()
if bSKSE
PlayerRef.EquipItemEx(EquippedItemLeft, 2)
else
PlayerRef.equipitem(EquippedItemLeft, false, true)
PlayerRef.EquipItem(EquippedItemLeft, false, true)
endif
endif
@ -241,10 +242,15 @@ Function equipeItems()
while index > 0
index -= 1
If wornArmor[index] && PlayerRef.GetItemCount(wornArmor[index]) > 0
;removing and readding items fixes the issue that set bonuses wouldn't apply properly after re-transforming
PlayerRef.RemoveItem(wornArmor[index], 1, true, _00E_TransformStorageREF)
_00E_TransformStorageREF.RemoveItem(wornArmor[index], 1, true, PlayerRef)
PlayerRef.EquipItem(wornArmor[index],false,true)
if bSKSE
; EquipItemEx triggers OnEquipped properly
PlayerRef.EquipItemEx(wornArmor[index], 0, false, false)
else
;removing and readding items fixes the issue that set bonuses wouldn't apply properly after re-transforming
PlayerRef.RemoveItem(wornArmor[index], 1, true, _00E_TransformStorageREF)
_00E_TransformStorageREF.RemoveItem(wornArmor[index], 1, true, PlayerRef)
PlayerRef.EquipItem(wornArmor[index], false, true)
endif
EndIf
Endwhile
endFunction
endFunction