Skip to content

Commit 9f7c940

Browse files
committed
Prevent execute part code in build screen
1 parent 8f4a9c4 commit 9f7c940

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

MoreParts/Parts/ContinuousTrackModule.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public override void Awake()
3131

3232
public void Start()
3333
{
34+
if (GameManager.main == null)
35+
{
36+
base.enabled = false;
37+
return;
38+
}
3439
this.Part.onPartUsed.AddListener(this.ToggleEnabled);
3540
this._on = this.getBoolVariable("wheel_on");
3641
this._traction = this.getDoubleVariable("traction");

MoreParts/Parts/ExcavatorModule.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public override void Awake()
4040

4141
private void Start()
4242
{
43+
if (GameManager.main == null)
44+
{
45+
base.enabled = false;
46+
return;
47+
}
4348
this._material_container = this.GetMaterialContainer();
4449
this._target_state = this.getDoubleVariable("target_state");
4550
this._state = this.getDoubleVariable("state");

MoreParts/Parts/HingeModule.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ public override void Awake()
4343

4444
private void Start()
4545
{
46-
47-
if(this._max_opening.Value > 180)
46+
if (GameManager.main == null)
47+
{
48+
base.enabled = false;
49+
return;
50+
}
51+
if (this._max_opening.Value > 180)
4852
{
4953
this._max_opening.Value = 180;
5054
}

0 commit comments

Comments
 (0)