Ship mounts: hide the thruster emitter with the invisible material

forceRenderingOff is not serialized, so the prototype's clone drew the
emitter again; the preview smoke's clone check caught it. The emitter's
materials become the template's invisible material, which survives
Instantiate and which EntityInstance keeps as the renderer's own material.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-03 14:48:51 +02:00
commit da2a299baa
2 changed files with 5 additions and 2 deletions

View file

@ -65,7 +65,8 @@ public static class ShipModPreview
ship.HullColliders[0].GetComponent<MeshCollider>() != null, "one hull collider with a MeshCollider");
Require(Inside(ship.MapIcon) && Inside(ship.Shield) && Inside(ship.TractorBeam), "map icon, shield and tractor inside the ship");
Require(ship.ThrusterHardpoints.Select(node => node.name).SequenceEqual(plan.Thrusters) &&
ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter) && node.Emitter.forceRenderingOff),
ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter) &&
node.Emitter.sharedMaterials.All(material => material == ship.InvisibleMaterial)),
"thruster hardpoints with unrendered emitter meshes");
Require(ship.RadiatorHardpoints.Select(node => node.name).SequenceEqual(plan.Radiators) &&
ship.RadiatorHardpoints.All(node => Inside(node) && Inside(node.Mesh)), "radiator hardpoints with meshes");