use cool pattern matching

This commit is contained in:
JohnCorby 2022-07-25 20:08:49 -07:00
parent 958b4c862f
commit 839eff6212

View File

@ -612,7 +612,7 @@ namespace NewHorizons.Handlers
var orbitLine = go.GetComponentInChildren<OrbitLine>()?.gameObject; var orbitLine = go.GetComponentInChildren<OrbitLine>()?.gameObject;
if (orbitLine != null) GameObject.Destroy(orbitLine); if (orbitLine != null) GameObject.Destroy(orbitLine);
var isMoon = newAO.GetAstroObjectType() == AstroObject.Type.Moon || newAO.GetAstroObjectType() == AstroObject.Type.Satellite || newAO.GetAstroObjectType() == AstroObject.Type.SpaceStation; var isMoon = newAO.GetAstroObjectType() is AstroObject.Type.Moon or AstroObject.Type.Satellite or AstroObject.Type.SpaceStation;
if (body.Config.Orbit.showOrbitLine) OrbitlineBuilder.Make(go, newAO, isMoon, body.Config); if (body.Config.Orbit.showOrbitLine) OrbitlineBuilder.Make(go, newAO, isMoon, body.Config);
DetectorBuilder.SetDetector(primary, newAO, go.GetComponentInChildren<ConstantForceDetector>()); DetectorBuilder.SetDetector(primary, newAO, go.GetComponentInChildren<ConstantForceDetector>());