diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 14:04:28 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 14:04:36 +0100 |
commit | fec522f3c77696ea1d7907a1a2484910f8e391ca (patch) | |
tree | 68b64977452531bc804bac7be3b4d45569f9109c /src/render.cpp | |
parent | e29c796801dd6b7a406ef457c0c68b4a1c7f527a (diff) |
Fix panicking units stopping for no reason.
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
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<v2f_t> *path) +void state_t::debug_path(v2f_t x, std::list<v2f_t> *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); } } |