From 9dcf264d65951581e750545a0c6c8c7fb6e2f884 Mon Sep 17 00:00:00 2001 From: KPhoenix Date: Fri, 7 Jul 2023 19:57:23 -0400 Subject: [PATCH] Fix Book requirements not updating from Objects #2 --- Source/objects.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Source/objects.cpp b/Source/objects.cpp index 4c6619a32..720eceb7a 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -35,6 +35,7 @@ #include "missiles.h" #include "monster.h" #include "options.h" +#include "qol/stash.h" #include "stores.h" #include "towners.h" #include "track.h" @@ -1987,6 +1988,15 @@ void OperateBook(Player &player, Object &book, bool sendmsg) NetSendCmdParam2(true, CMD_CHANGE_SPELL_LEVEL, static_cast(SpellID::Guardian), newSpellLevel); } + if (&player == MyPlayer) { + for (Item &item : InventoryPlayerItemsRange { player }) { + item.updateRequiredStatsCacheForPlayer(player); + } + if (IsStashOpen) { + Stash.RefreshItemStatFlags(); + } + } + Quests[Q_SCHAMB]._qactive = QUEST_DONE; NetSendCmdQuest(true, Quests[Q_SCHAMB]); } @@ -2560,6 +2570,15 @@ void OperateShrineEnchanted(Player &player) player._pSplLvl[spellToReduce] = newSpellLevel; NetSendCmdParam2(true, CMD_CHANGE_SPELL_LEVEL, spellToReduce, newSpellLevel); } + + if (&player == MyPlayer) { + for (Item &item : InventoryPlayerItemsRange { player }) { + item.updateRequiredStatsCacheForPlayer(player); + } + if (IsStashOpen) { + Stash.RefreshItemStatFlags(); + } + } } InitDiabloMsg(EMSG_SHRINE_ENCHANTED); @@ -2596,6 +2615,15 @@ void OperateShrineCostOfWisdom(Player &player, SpellID spellId, diablo_message m NetSendCmdParam2(true, CMD_CHANGE_SPELL_LEVEL, static_cast(spellId), newSpellLevel); } + if (&player == MyPlayer) { + for (Item &item : InventoryPlayerItemsRange { player }) { + item.updateRequiredStatsCacheForPlayer(player); + } + if (IsStashOpen) { + Stash.RefreshItemStatFlags(); + } + } + uint32_t t = player._pMaxManaBase / 10; int v1 = player._pMana - player._pManaBase; int v2 = player._pMaxMana - player._pMaxManaBase;