Skip to content

Commit

Permalink
Version 1.15a
Browse files Browse the repository at this point in the history
Timewarp fix
  • Loading branch information
SirDiazo committed Sep 14, 2014
1 parent 3643d6d commit 7c097a3
Showing 1 changed file with 46 additions and 4 deletions.
50 changes: 46 additions & 4 deletions AGExt/Flight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public static void LoadGroupVisibilityNames(string LoadString) //ver2 only

public void VesselOffRails(Vessel vsl) //load vessels here
{
//print("Vessel off rails! " + vsl.vesselName);
print("Vessel off rails! " + vsl.vesselName);
ConfigNode vslNode = new ConfigNode();
bool checkIsVab = true;
try
Expand Down Expand Up @@ -738,7 +738,7 @@ public void VesselOffRails(Vessel vsl) //load vessels here

public void VesselOnRails(Vessel vsl)
{
print("Vessel on rails! " );
print("Vessel on rails! " + vsl.name );
partOldVessel.RemoveAll(vsl2 => vsl2.pVsl == vsl);
List<AGXAction> UnloadVslActionsCheck = new List<AGXAction>();
UnloadVslActionsCheck.AddRange(AllVesselsActions.Where(agx => agx.ba.listParent.part.vessel == vsl));
Expand All @@ -757,6 +757,35 @@ public void VesselOnRails(Vessel vsl)
AGXFlightNode.RemoveNode(vsl.id.ToString());
}

if (vsl == FlightGlobals.ActiveVessel)
{
if(vslToUnload.HasValue("name"))
{
vslToUnload.RemoveValue("name");
}
vslToUnload.AddValue("name",FlightGlobals.ActiveVessel.vesselName);
if (vslToUnload.HasValue("currentKeyset"))
{
vslToUnload.RemoveValue("currentKeyset");
}
vslToUnload.AddValue("currentKeyset", CurrentKeySet.ToString());
if (vslToUnload.HasValue("groupNames"))
{
vslToUnload.RemoveValue("groupNames");
}
vslToUnload.AddValue("groupNames", SaveGroupNames(""));
if (vslToUnload.HasValue("groupVisibility"))
{
vslToUnload.RemoveValue("groupVisibility");
}
vslToUnload.AddValue("groupVisibility", SaveGroupVisibility(""));
if (vslToUnload.HasValue("groupVisibilityNames"))
{
vslToUnload.RemoveValue("groupVisibilityNames");
}
vslToUnload.AddValue("groupVisibilityNames", SaveGroupVisibilityNames(""));
}

foreach (Part p in vsl.Parts)
{
List<AGXAction> thisPartsActions = new List<AGXAction>();
Expand Down Expand Up @@ -988,7 +1017,7 @@ public void AGXOnDraw()
// SettingsWinRect = GUI.Window(673467780, SettingsWinRect, AGXMethods.SettingsWindow, "AGX Settings", AGXWinStyle);
//}

if (ShowAGXMod)
if (ShowAGXMod && TimeWarp.CurrentRate ==1)
{
if (ShowAGXFlightWin)
{
Expand Down Expand Up @@ -1153,6 +1182,8 @@ public void FlightWindow(int WindowID)

ShowGroupsInFlightWindow = !ShowGroupsInFlightWindow;
}


if (GUI.Button(new Rect(5, 5, 75, 20), "Edit", AGXBtnStyle))
{

Expand Down Expand Up @@ -1193,6 +1224,7 @@ public void FlightWindow(int WindowID)
//print("AGX " + ToggleState);

}



//for (int i = 1; i <= 250; i = i + 1)
Expand Down Expand Up @@ -3215,7 +3247,17 @@ public void Update()
// print("Part Flight Id " + FlightGlobals.ActiveVessel.rootPart.flightID);
// print("Part UID " + FlightGlobals.ActiveVessel.rootPart.uid);
// print("Part mission id " + FlightGlobals.ActiveVessel.rootPart.missionID);
//print("Vessel landedat" + FlightGlobals.ActiveVessel.landedAt);
if (TimeWarp.CurrentRate != 1)
{
if (ShowSelectedWin || ShowKeySetWin)
{

SaveEverything();
ShowSelectedWin = false;
ShowKeySetWin = false;
}

}
}
catch(Exception e)
{
Expand Down

0 comments on commit 7c097a3

Please sign in to comment.