Skip to content

Commit 624683a

Browse files
committed
added unreachanble
1 parent f46672b commit 624683a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

source/hud/entity_overlay.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,20 +646,25 @@ namespace omath::hud
646646
const auto box_width = std::abs(m_canvas.top_right_corner.x - m_canvas.top_left_corner.x);
647647
const auto box_height = std::abs(m_canvas.bottom_left_corner.y - m_canvas.top_left_corner.y);
648648

649-
const auto box_center = m_canvas.top_left_corner+Vector2{box_width, box_height} / 2.f;
649+
const auto box_center = m_canvas.top_left_corner + Vector2{box_width, box_height} / 2.f;
650650

651651
m_renderer->add_line(box_center, proj_widget.position, proj_widget.color, proj_widget.line_size);
652652

653653
if (proj_widget.figure == widget::ProjectileAim::Figure::CIRCLE)
654654
{
655655
m_renderer->add_filled_circle(proj_widget.position, proj_widget.size, proj_widget.color);
656+
return;
656657
}
657-
else if (proj_widget.figure == widget::ProjectileAim::Figure::SQUARE)
658+
659+
if (proj_widget.figure == widget::ProjectileAim::Figure::SQUARE)
658660
{
659661
const auto box_min = proj_widget.position - Vector2{proj_widget.size, proj_widget.size} / 2.f;
660662
const auto box_max = proj_widget.position + Vector2{proj_widget.size, proj_widget.size} / 2.f;
661663
m_renderer->add_filled_rectangle(box_min, box_max, proj_widget.color);
664+
return;
662665
}
666+
667+
std::unreachable();
663668
}
664669

665670
void EntityOverlay::draw_progress_ring(const Vector2<float>& center, const widget::ProgressRing& ring)

0 commit comments

Comments
 (0)