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

Method getMaxStackLimit

src/items.cpp:4101–4127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4099}
4100
4101int Item::getMaxStackLimit(int player) const
4102{
4103 if ( !shouldItemStack(player, true) )
4104 {
4105 return 1;
4106 }
4107
4108 int maxStack = 100;
4109 if ( itemTypeIsThrownBall(this->type) )
4110 {
4111 maxStack = QUIVER_MAX_AMMO_QTY - 1;
4112 }
4113 else if ( itemCategory(this) == THROWN || itemCategory(this) == GEM )
4114 {
4115 maxStack = THROWN_GEM_MAX_STACK_QTY;
4116 }
4117 else if ( itemTypeIsQuiver(this->type) )
4118 {
4119 maxStack = QUIVER_MAX_AMMO_QTY - 1;
4120 }
4121 else if ( type == TOOL_METAL_SCRAP || type == TOOL_MAGIC_SCRAP )
4122 {
4123 maxStack = SCRAP_MAX_STACK_QTY - 1;
4124 }
4125
4126 return maxStack;
4127}
4128
4129ItemStackResult getItemStackingBehaviorIndividualItemCheck(const int player, Item* itemToCheck, Item* itemDestinationStack, int& newQtyForCheckedItem, int& newQtyForDestItem)
4130{

Calls 3

itemTypeIsThrownBallFunction · 0.85
itemTypeIsQuiverFunction · 0.85
itemCategoryFunction · 0.70

Tested by

no test coverage detected