diff --git a/Source/items.cpp b/Source/items.cpp index 1b41dee54..d00159246 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -4586,6 +4586,23 @@ void RechargeItem(Item &item, Player &player) } while (item._iCharges < item._iMaxCharges); item._iCharges = std::min(item._iCharges, item._iMaxCharges); + + if (&player != MyPlayer) + return; + if (&item == &player.InvBody[INVLOC_HAND_LEFT]) { + NetSendCmdChItem(true, INVLOC_HAND_LEFT); + return; + } + if (&item == &player.InvBody[INVLOC_HAND_RIGHT]) { + NetSendCmdChItem(true, INVLOC_HAND_RIGHT); + return; + } + for (size_t i = 0; i < player._pNumInv; i++) { + if (&item == &player.InvList[i]) { + NetSyncInvItem(player, i); + break; + } + } } bool ApplyOilToItem(Item &item, Player &player) diff --git a/Source/stores.cpp b/Source/stores.cpp index 3571091af..92484c5db 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -1744,10 +1744,13 @@ void WitchRechargeItem(int price) Player &myPlayer = *MyPlayer; int8_t i = storehidx[idx]; - if (i < 0) + if (i < 0) { myPlayer.InvBody[INVLOC_HAND_LEFT]._iCharges = myPlayer.InvBody[INVLOC_HAND_LEFT]._iMaxCharges; - else + NetSendCmdChItem(true, INVLOC_HAND_LEFT); + } else { myPlayer.InvList[i]._iCharges = myPlayer.InvList[i]._iMaxCharges; + NetSyncInvItem(myPlayer, i); + } CalcPlrInv(myPlayer, true); }