1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-20 20:09:41 +00:00

[Client] Add logging for items added to & removed from player by server

Additionally, adjust comment related to potion creation to mention sending of stored item removals.
This commit is contained in:
David Cernat 2020-02-25 09:53:42 +02:00
parent dae805dbc1
commit 9d3afc019a
2 changed files with 8 additions and 1 deletions

View file

@ -576,7 +576,8 @@ MWMechanics::Alchemy::Result MWMechanics::Alchemy::create (const std::string& na
Send an ID_RECORD_DYNAMIC packet with the potion we've been creating
now that we know its quantity
Stop avoiding the sending of ID_PLAYER_INVENTORY packets
Stop avoiding the sending of ID_PLAYER_INVENTORY packets and send all
item removals stored so far
*/
mwmp::Main::get().getNetworking()->getWorldstate()->sendPotionRecord(&mStoredPotion, brewedCount);
mwmp::Main::get().getLocalPlayer()->avoidSendingInventoryPackets = false;

View file

@ -685,6 +685,8 @@ void LocalPlayer::addItems()
if (!item.soul.empty())
itemPtr.getCellRef().setSoul(item.soul);
LOG_APPEND(TimedLog::LOG_INFO, "- Adding inventory item %s with count %i", item.refId.c_str(), item.count);
ptrStore.add(itemPtr, item.count, ptrPlayer);
}
catch (std::exception&)
@ -779,7 +781,11 @@ void LocalPlayer::removeItems()
MWWorld::ContainerStore &ptrStore = ptrPlayer.getClass().getContainerStore(ptrPlayer);
for (const auto &item : inventoryChanges.items)
{
ptrStore.remove(item.refId, item.count, ptrPlayer);
LOG_APPEND(TimedLog::LOG_INFO, "- Removing inventory item %s with count %i", item.refId.c_str(), item.count);
}
}
void LocalPlayer::removeSpells()