Skip to content

Commit

Permalink
fix uncaught exception: invalid vector subscript in BlockWrapsRendere…
Browse files Browse the repository at this point in the history
…r on invalid block state
  • Loading branch information
MihailRis committed Jan 31, 2025
1 parent 0bbd215 commit 1e851b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/graphics/render/BlockWrapsRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ void BlockWrapsRenderer::draw(const BlockWrapper& wrapper) {
);
break;
case BlockModel::aabb: {
const auto& aabb = def.rt.hitboxes[vox->state.rotation].at(0);
const auto& aabb =
(def.rotatable ? def.rt.hitboxes[vox->state.rotation]
: def.hitboxes)
.at(0);
const auto& size = aabb.size();
regions[0].scale(size.z, size.y);
regions[1].scale(size.z, size.y);
Expand Down

0 comments on commit 1e851b0

Please sign in to comment.