refactor: PVS-Studio warnings fixes
This commit is contained in:
@@ -26,8 +26,8 @@ bool ItemStack::accepts(const ItemStack& other) const {
|
||||
}
|
||||
|
||||
void ItemStack::move(ItemStack& item, const ContentIndices* indices) {
|
||||
auto def = indices->items.get(item.getItemId()); //FIXME: Potentional null pointer
|
||||
int count = std::min(item.count, def->stackSize - this->count); //-V522
|
||||
auto& def = indices->items.require(item.getItemId());
|
||||
int count = std::min(item.count, def.stackSize - this->count);
|
||||
if (isEmpty()) {
|
||||
set(ItemStack(item.getItemId(), count));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user