1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-04-01 19:36:42 +00:00

[Client] Use clearer boolean name for checks regarding inventory sending

This commit is contained in:
David Cernat 2020-02-22 23:59:42 +02:00
parent e78503d5f3
commit 31c0f5c976
4 changed files with 7 additions and 7 deletions

View file

@ -75,7 +75,7 @@ LocalPlayer::LocalPlayer()
jailEndText = ""; jailEndText = "";
isUsingBed = false; isUsingBed = false;
isReceivingInventory = false; avoidSendingInventoryPackets = false;
isReceivingQuickKeys = false; isReceivingQuickKeys = false;
isPlayingAnimation = false; isPlayingAnimation = false;
diedSinceArrestAttempt = false; diedSinceArrestAttempt = false;

View file

@ -19,7 +19,7 @@ namespace mwmp
bool receivedCharacter; bool receivedCharacter;
bool isUsingBed; bool isUsingBed;
bool isReceivingInventory; bool avoidSendingInventoryPackets;
bool isReceivingQuickKeys; bool isReceivingQuickKeys;
bool isPlayingAnimation; bool isPlayingAnimation;
bool diedSinceArrestAttempt; bool diedSinceArrestAttempt;

View file

@ -28,7 +28,7 @@ namespace mwmp
// Because we send PlayerInventory packets from the same OpenMW methods that we use to set the // Because we send PlayerInventory packets from the same OpenMW methods that we use to set the
// items received, we need to set a boolean to prevent resending the items set here // items received, we need to set a boolean to prevent resending the items set here
localPlayer.isReceivingInventory = true; localPlayer.avoidSendingInventoryPackets = true;
if (inventoryAction == InventoryChanges::ADD) if (inventoryAction == InventoryChanges::ADD)
localPlayer.addItems(); localPlayer.addItems();
@ -37,7 +37,7 @@ namespace mwmp
else // InventoryChanges::SET else // InventoryChanges::SET
localPlayer.setInventory(); localPlayer.setInventory();
localPlayer.isReceivingInventory = false; localPlayer.avoidSendingInventoryPackets = false;
} }
} }
}; };

View file

@ -212,7 +212,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::unstack(const Ptr &ptr,
{ {
mwmp::LocalPlayer *localPlayer = mwmp::Main::get().getLocalPlayer(); mwmp::LocalPlayer *localPlayer = mwmp::Main::get().getLocalPlayer();
if (!localPlayer->isReceivingInventory) if (!localPlayer->avoidSendingInventoryPackets)
localPlayer->sendItemChange(ptr, ptr.getRefData().getCount() - count, mwmp::InventoryChanges::ADD); localPlayer->sendItemChange(ptr, ptr.getRefData().getCount() - count, mwmp::InventoryChanges::ADD);
} }
/* /*
@ -315,7 +315,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr
{ {
mwmp::LocalPlayer *localPlayer = mwmp::Main::get().getLocalPlayer(); mwmp::LocalPlayer *localPlayer = mwmp::Main::get().getLocalPlayer();
if (!localPlayer->isReceivingInventory) if (!localPlayer->avoidSendingInventoryPackets)
{ {
int realCount = count; int realCount = count;
@ -540,7 +540,7 @@ int MWWorld::ContainerStore::remove(const Ptr& item, int count, const Ptr& actor
{ {
mwmp::LocalPlayer *localPlayer = mwmp::Main::get().getLocalPlayer(); mwmp::LocalPlayer *localPlayer = mwmp::Main::get().getLocalPlayer();
if (!localPlayer->isReceivingInventory) if (!localPlayer->avoidSendingInventoryPackets)
localPlayer->sendItemChange(item, count, mwmp::InventoryChanges::REMOVE); localPlayer->sendItemChange(item, count, mwmp::InventoryChanges::REMOVE);
} }
/* /*