[Client] Send equipment packets whenever an item charge or count changes

Since the beginnings of TES3MP, equipment packets have only been sent whenever an item has been replaced by an item with a different refId, with changes in an item's charge or count not sending a packet (but being included in the next packet sent as a result of a refId change). The reason for this was ostensibly the fact that every single equipment packet always included the details for all 19 equipment items (as per Koncord's original design decision), which would have led to massive packet spam if such a packet was sent every time you shot an arrow or lost a little bit of your armor's condition.

With minimalist equipment packets, it is now viable to send equipment packets whenever any item changes in some way, by having the equipment packet contain only that one item.
sol2-server-rewrite
David Cernat 7 years ago
parent 399e049d87
commit 3b07dc4b42

@ -454,7 +454,11 @@ void LocalPlayer::updateEquipment(bool forceUpdate)
if (it != invStore.end())
{
if (!::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), equipmentItems[slot].refId) || forceUpdate)
if (!::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), equipmentItems[slot].refId) ||
it->getCellRef().getCharge() != item.charge ||
it->getCellRef().getEnchantmentCharge() != item.enchantmentCharge ||
it->getRefData().getCount() != item.count ||
forceUpdate)
{
equipmentIndexChanges.push_back(slot);

Loading…
Cancel
Save