mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: PVS-Studio V522 mark false
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
4efa574eec
commit
3621e7ce1b
18 changed files with 81 additions and 81 deletions
|
|
@ -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());
|
||||
int count = std::min(item.count, def->stackSize - this->count);
|
||||
auto def = indices->items.get(item.getItemId()); //FIXME: Potentional null pointer
|
||||
int count = std::min(item.count, def->stackSize - this->count); //-V522
|
||||
if (isEmpty()) {
|
||||
set(ItemStack(item.getItemId(), count));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue