MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / stackWith

Method stackWith

source/game/StarItem.cpp:99–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99bool Item::stackWith(ItemPtr const& item) {
100 uint64_t take = couldStack(item);
101
102 if (take > 0 && item->consume(take)) {
103 m_count += take;
104 return true;
105 } else {
106 return false;
107 }
108}
109
110bool Item::matches(ItemDescriptor const& descriptor, bool exactMatch) const {
111 return descriptor.name() == m_name && (!exactMatch || descriptor.parameters() == m_parameters);

Callers 9

updateMethod · 0.45
putItemsMethod · 0.45
swapItemsMethod · 0.45
addItemsMethod · 0.45
stackItemsMethod · 0.45
condenseStacksMethod · 0.45
InventoryPaneMethod · 0.45
giveContainerResultMethod · 0.45
giveContainerResultMethod · 0.45

Calls 1

consumeMethod · 0.45

Tested by

no test coverage detected