From fec522f3c77696ea1d7907a1a2484910f8e391ca Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 19 Dec 2017 14:04:28 +0100 Subject: Fix panicking units stopping for no reason. --- src/render.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/render.cpp') diff --git a/src/render.cpp b/src/render.cpp index 8f2fdc7..76701b6 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -277,20 +277,15 @@ void state_t::render_line(v2f_t x0, v2f_t x1, sf::Color color) window->draw(line, 2, sf::Lines); } -void state_t::debug_path(std::list *path) +void state_t::debug_path(v2f_t x, std::list *path) { - bool first = true; sf::Vertex line[2]; + line[0] = sf::Vertex(x, sf::Color::Blue); + for (v2f_t &point : *path) { line[1] = line[0]; line[0] = sf::Vertex(point, sf::Color::Blue); - - if (first) { - first = false; - continue; - } - window->draw(line, 2, sf::Lines); } } -- cgit