From 75e7e539959e826e3c5f639b8858ac131c957718 Mon Sep 17 00:00:00 2001 From: Tatjam Date: Mon, 21 Sep 2020 13:45:02 +0200 Subject: [PATCH] Now the machines with no markers are correctly shown (#27) --- src/game/scenes/editor/interfaces/WireInterface.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/scenes/editor/interfaces/WireInterface.cpp b/src/game/scenes/editor/interfaces/WireInterface.cpp index 35e60d90..cf926eda 100755 --- a/src/game/scenes/editor/interfaces/WireInterface.cpp +++ b/src/game/scenes/editor/interfaces/WireInterface.cpp @@ -108,12 +108,12 @@ bool WireInterface::do_interface(const CameraUniforms& cu, glm::dvec3 ray_start, Machine* m = *it; if(m->editor_location_marker.empty()) { - machines_with_marker.push_back(m); - it = pair.second.erase(it); + it++; } else { - it++; + machines_with_marker.push_back(m); + it = pair.second.erase(it); } } @@ -121,7 +121,7 @@ bool WireInterface::do_interface(const CameraUniforms& cu, glm::dvec3 ray_start, glm::dvec3 pos = to_dvec3(p->get_piece("p_root")->packed_tform.getOrigin()); // Draw the polygon with the machines on its edges // and a central "indicator" - int polygon_machines = machines_with_marker.size(); + int polygon_machines = pair.second.size(); float dangle = glm::two_pi() / polygon_machines; @@ -176,7 +176,7 @@ bool WireInterface::do_interface(const CameraUniforms& cu, glm::dvec3 ray_start, } // Draw the machines at a marker location - for(Machine* m : pair.second) + for(Machine* m : machines_with_marker) { glm::dvec3 mpos = p->get_piece("p_root")->get_marker_position(m->editor_location_marker);