refactor: PVS-Studio warnings fixes
This commit is contained in:
@@ -18,7 +18,7 @@ ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) : conte
|
||||
auto atlas = assets->get<Atlas>("blocks");
|
||||
|
||||
for (uint i = 0; i < indices->blocks.count(); i++) {
|
||||
Block* def = indices->blocks.get(i); //FIXME: Potential null pointer
|
||||
auto def = indices->blocks.getWriteable(i); //FIXME: Potential null pointer
|
||||
for (uint side = 0; side < 6; side++) {
|
||||
const std::string& tex = def->textureFaces[side]; //-V522
|
||||
if (atlas->has(tex)) {
|
||||
|
||||
@@ -25,8 +25,8 @@ LevelFrontend::LevelFrontend(
|
||||
"block-previews"
|
||||
);
|
||||
controller->getBlocksController()->listenBlockInteraction(
|
||||
[=](Player* player, glm::ivec3 pos, const Block* def, BlockInteraction type) {
|
||||
auto material = level->content->findBlockMaterial(def->material);
|
||||
[=](Player* player, glm::ivec3 pos, const Block& def, BlockInteraction type) {
|
||||
auto material = level->content->findBlockMaterial(def.material);
|
||||
if (material == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user