MCPcopy Create free account
hub / github.com/TurningWheel/Barony / getItemEmptySlotStackingBehavior

Function getItemEmptySlotStackingBehavior

src/items.cpp:4236–4249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4234}
4235
4236void getItemEmptySlotStackingBehavior(const int player, Item& itemToCheck, int& newQtyForCheckedItem, int& newQtyForDestItem)
4237{
4238 int maxStack = itemToCheck.getMaxStackLimit(player);
4239 if ( itemToCheck.count > maxStack )
4240 {
4241 newQtyForCheckedItem = itemToCheck.count - maxStack;
4242 newQtyForDestItem = maxStack;
4243 }
4244 else
4245 {
4246 newQtyForCheckedItem = 0;
4247 newQtyForDestItem = itemToCheck.count;
4248 }
4249}
4250
4251ItemStackResult getItemStackingBehaviorIntoChest(const int player, Item* itemToCheck, Item* itemDestinationStack, int& newQtyForCheckedItem, int& newQtyForDestItem)
4252{

Callers 2

releaseChestItemFunction · 0.85
releaseItemFunction · 0.85

Calls 1

getMaxStackLimitMethod · 0.80

Tested by

no test coverage detected