Skip to content

Commit

Permalink
0.16.2 update
Browse files Browse the repository at this point in the history
Fixed loading craft files that contain IR parts.
  • Loading branch information
sirkut committed Jun 21, 2014
1 parent 2b4c931 commit 231b451
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions InfernalRobotics/InfernalRobotics/GUI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -198,7 +198,7 @@ void onPartAttach(GameEvents.HostTargetAction<Part, Part> host_target)
// add_servo(servo);
//}
//EditorLogic.fetch.ship.Parts.Count
if ((EditorLogic.fetch.ship.parts.Count >= partCounter) && (EditorLogic.fetch.ship.parts.Count != partCounter) )
if ((EditorLogic.fetch.ship.parts.Count >= partCounter) && (EditorLogic.fetch.ship.parts.Count != partCounter))
{
Part part = host_target.host;
if ((partCounter != 1) && (EditorLogic.fetch.ship.parts.Count != 1))
Expand All @@ -210,6 +210,19 @@ void onPartAttach(GameEvents.HostTargetAction<Part, Part> host_target)
partCounter = EditorLogic.fetch.ship.parts.Count;
}
}
if ((EditorLogic.fetch.ship.parts.Count == 0) && (partCounter == 0))
{
Part part = host_target.host;
if ((partCounter != 1) && (EditorLogic.fetch.ship.parts.Count != 1))
{
foreach (var p in part.GetComponentsInChildren<MuMechToggle>())
{
add_servo(p);
}
partCounter = EditorLogic.fetch.ship.parts.Count;
}
}

}

void onPartRemove(GameEvents.HostTargetAction<Part, Part> host_target)
Expand Down

0 comments on commit 231b451

Please sign in to comment.