refactor: PVS-Studio warnings fixes

This commit is contained in:
MihailRis
2024-08-04 01:30:52 +03:00
parent 245b39be62
commit 47db626145
14 changed files with 81 additions and 69 deletions
+2 -2
View File
@@ -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;
}