Use existing method for finding component with ID

This commit is contained in:
SiboVG 2023-06-28 15:52:27 +02:00
parent 82b9ab89c7
commit 8f3fe0e44a

View File

@ -148,12 +148,7 @@ class FlightDataBranchHandler extends AbstractElementHandler {
Rocket rocket = context.getOpenRocketDocument().getRocket();
sourceID = attributes.get("source");
if (sourceID != null) {
for (RocketComponent child : rocket.getAllChildren()) {
if (child.getID().equals(sourceID)) {
source = child;
break;
}
}
source = rocket.findComponent(sourceID);
}
branch.addEvent(new FlightEvent(type, time, source));