Skip to content

Commit

Permalink
1.31f
Browse files Browse the repository at this point in the history
Fix duplicating actions
  • Loading branch information
SirDiazo committed Apr 12, 2015
1 parent 48ffe6a commit 9db2220
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions AGExt/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2363,17 +2363,18 @@ public void SelParts(int WindowID)
{
ToAdd = new AGXAction() { prt = agPrt.AGPart, ba = PartActionsList.ElementAt(ActionsCount - 1), group = AGXCurActGroup, activated = false };
}
List<AGXAction> Checking = new List<AGXAction>();
Checking.AddRange(CurrentVesselActions);
Checking.RemoveAll(p => p.group != ToAdd.group);
//List<AGXAction> Checking = new List<AGXAction>();
//Checking.AddRange(CurrentVesselActions);
//Checking.RemoveAll(p => p.group != ToAdd.group);

Checking.RemoveAll(p => p.prt != ToAdd.prt);
//Checking.RemoveAll(p => p.prt != ToAdd.prt);

Checking.RemoveAll(p => p.ba != ToAdd.ba);
//Checking.RemoveAll(p => p.ba != ToAdd.ba);



if (Checking.Count == 0)
//if (Checking.Count == 0)
if(!CurrentVesselActions.Contains(ToAdd))
{

CurrentVesselActions.Add(ToAdd);
Expand Down Expand Up @@ -4127,7 +4128,7 @@ public static void EditorLoadFromNode()
foreach (ConfigNode actNode in prtNode.nodes)
{
AGXAction actToAdd = AGextScenario.LoadAGXActionVer2(actNode, gamePart, ShowAmbiguousMessage);
if (actToAdd.ba != null)
if (actToAdd.ba != null && !CurrentVesselActions.Contains(actToAdd))
{
CurrentVesselActions.Add(actToAdd);
}
Expand Down
4 changes: 2 additions & 2 deletions AGExt/Flight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4083,7 +4083,7 @@ public void DockingEvent()
//print("node " + actNode + " " + gamePart.ConstructID);
AGXAction actToAdd = AGextScenario.LoadAGXActionVer2(actNode, gamePart, ShowAmbiguousMessage2);
//print("act to add " + actToAdd.ba);
if (actToAdd.ba != null)
if (actToAdd.ba != null && !CurrentVesselActions.Contains(actToAdd))
{
CurrentVesselActions.Add(actToAdd);
}
Expand Down Expand Up @@ -4490,7 +4490,7 @@ public void Update()
//print("node " + actNode + " " + gamePart.ConstructID);
AGXAction actToAdd = AGextScenario.LoadAGXActionVer2(actNode, gamePart, ShowAmbiguousMessage2);
//print("act to add " + actToAdd.ba);
if (actToAdd.ba != null)
if (actToAdd.ba != null && !CurrentVesselActions.Contains(actToAdd))
{
CurrentVesselActions.Add(actToAdd);
}
Expand Down
2 changes: 1 addition & 1 deletion AGExt/Instantly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class AGXMainMenu :PartModule
//abandoned module, no longer needed for key rebinding
public void Start()
{
print("AGExt Ver. 1.31e loaded");
print("AGExt Ver. 1.31f loaded");


}
Expand Down

0 comments on commit 9db2220

Please sign in to comment.