[Client] Limit PlayerEquipment packets sent by recharging enchantments

remotes/1728160796594174844/tmp_0.7.0-alpha
David Cernat 7 years ago
parent 715cac807d
commit 8c0b75d9f4

@ -1,5 +1,6 @@
#include <components/esm/esmwriter.hpp>
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/Utils.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/journal.hpp"
@ -476,9 +477,11 @@ void LocalPlayer::updateEquipment(bool forceUpdate)
if (it != invStore.end())
{
if (!::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), equipmentItems[slot].refId) ||
it->getCellRef().getCharge() != item.charge ||
it->getCellRef().getEnchantmentCharge() != item.enchantmentCharge ||
MWWorld::CellRef &cellRef = it->getCellRef();
if (Misc::StringUtils::ciEqual(cellRef.getRefId(), item.refId) == false ||
cellRef.getCharge() != item.charge ||
Utils::compareFloats(cellRef.getEnchantmentCharge(), item.enchantmentCharge, 1.0f) == false ||
it->getRefData().getCount() != item.count ||
forceUpdate)
{

Loading…
Cancel
Save