Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cell-change crash from SetActorInventory() calling s_unequipAll followed by s_removeAllItems #726

Merged
merged 5 commits into from
Oct 26, 2024
4 changes: 3 additions & 1 deletion Code/client/Games/Skyrim/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ void Actor::SetActorInventory(const Inventory& aInventory) noexcept
{
spdlog::info("Setting inventory for actor {:X}", formID);

UnEquipAll();
// The UnEquipAll() that used to be here is redundant,
// as RemoveAllItems() unequips every item if needed.
// Placing this UnEquipAll() here seems to trigger a Skyrim bug/race.

SetInventory(aInventory);
SetMagicEquipment(aInventory.CurrentMagicEquipment);
Expand Down
Loading