This commit is contained in:
@@ -287,6 +287,12 @@ struct PlayerInventoryT {
|
||||
}
|
||||
}
|
||||
|
||||
void enforce_stack_limits(std::shared_ptr<const ItemData::StackLimits> stack_limits) {
|
||||
for (size_t z = 0; z < std::min<uint8_t>(this->num_items, this->items.size()); z++) {
|
||||
this->items[z].data.enforce_stack_size_limits(*stack_limits);
|
||||
}
|
||||
}
|
||||
|
||||
operator PlayerInventoryT<!BE>() const {
|
||||
PlayerInventoryT<!BE> ret;
|
||||
ret.num_items = this->num_items;
|
||||
@@ -410,6 +416,12 @@ struct PlayerBankT {
|
||||
}
|
||||
}
|
||||
|
||||
void enforce_stack_limits(std::shared_ptr<const ItemData::StackLimits> stack_limits) {
|
||||
for (size_t z = 0; z < std::min<uint8_t>(this->num_items, this->items.size()); z++) {
|
||||
this->items[z].data.enforce_stack_size_limits(*stack_limits);
|
||||
}
|
||||
}
|
||||
|
||||
template <size_t DestSlotCount, bool DestBE>
|
||||
operator PlayerBankT<DestSlotCount, DestBE>() const {
|
||||
PlayerBankT<DestSlotCount, DestBE> ret;
|
||||
|
||||
Reference in New Issue
Block a user