From b95cf4fd00c226094cbaec21a35dabf2cbd8890d Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 18 Jul 2021 15:04:25 +0200 Subject: [PATCH] Set the ptr's custom data before filling the store so leveled lists have access to the level --- apps/openmw/mwclass/npc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index f7e78a299f..691dfe5871 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -383,15 +383,15 @@ namespace MWClass if (!spellsInitialised) data->mNpcStats.getSpells().addAllToInstance(ref->mBase->mSpells.mList); - // inventory - // setting ownership is used to make the NPC auto-equip his initial equipment only, and not bartered items - data->mInventoryStore.fill(ref->mBase->mInventory, ptr.getCellRef().getRefId()); - data->mNpcStats.setGoldPool(gold); // store ptr.getRefData().setCustomData(std::move(data)); + // inventory + // setting ownership is used to make the NPC auto-equip his initial equipment only, and not bartered items + getInventoryStore(ptr).fill(ref->mBase->mInventory, ptr.getCellRef().getRefId()); + getInventoryStore(ptr).autoEquip(ptr); } }