[fixes #741] RailButtons will correctly identify their first parent BodyTube

This commit is contained in:
Daniel_M_Williams 2020-08-16 14:32:29 -04:00
parent e90318a7ac
commit 8a14d98fcc

View File

@ -237,8 +237,10 @@ public class RailButton extends ExternalComponent implements AnglePositionable,
double parentRadius=0;
for (body = this.getParent(); body != null; body = body.getParent()) {
if (body instanceof BodyTube)
if (body instanceof BodyTube) {
parentRadius = ((BodyTube) body).getOuterRadius();
break;
}
}
this.radialDistance_m = parentRadius;