Browse Source

Fix Book requirements not updating from Objects #2

pull/6323/head
KPhoenix 3 years ago committed by Anders Jenbo
parent
commit
9dcf264d65
  1. 28
      Source/objects.cpp

28
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<uint16_t>(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<uint16_t>(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;

Loading…
Cancel
Save