mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor: PVS-Studio warnings fixes
This commit is contained in:
parent
245b39be62
commit
47db626145
14 changed files with 81 additions and 69 deletions
|
|
@ -153,8 +153,8 @@ int64_t BlocksController::createBlockInventory(int x, int y, int z) {
|
|||
auto inv = chunk->getBlockInventory(lx, y, lz);
|
||||
if (inv == nullptr) {
|
||||
auto indices = level->content->getIndices();
|
||||
auto def = indices->blocks.get(chunk->voxels[vox_index(lx, y, lz)].id); //FIXME: Potentional null pointer
|
||||
int invsize = def->inventorySize; //-V522
|
||||
auto& def = indices->blocks.require(chunk->voxels[vox_index(lx, y, lz)].id);
|
||||
int invsize = def.inventorySize;
|
||||
if (invsize == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue