diff --git a/1.4/Assemblies/AchtungMod.dll b/1.4/Assemblies/AchtungMod.dll index a73526c..ed12ae4 100644 Binary files a/1.4/Assemblies/AchtungMod.dll and b/1.4/Assemblies/AchtungMod.dll differ diff --git a/Source/Controller.cs b/Source/Controller.cs index 479fcde..e85cb07 100644 --- a/Source/Controller.cs +++ b/Source/Controller.cs @@ -80,6 +80,8 @@ bool ShowMenu(MultiActions actions, bool forceMenu, Map map, IntVec3 cell) suppressMenu = true; } } + if (menuAdded) + EndDragging(); if (menuAdded == false && Achtung.Settings.positioningEnabled == false) return true; Event.current.Use(); diff --git a/Source/Main.cs b/Source/Main.cs index 6f01704..30c1f7b 100644 --- a/Source/Main.cs +++ b/Source/Main.cs @@ -7,6 +7,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.IO.Ports; using System.Linq; using System.Reflection; using System.Reflection.Emit; @@ -93,27 +94,44 @@ static IEnumerator Looper() while (true) { var jobs = ForcedWork.Instance.PrimaryForcedJobs(); + var didYield = false; foreach (var job in jobs) { var map = job?.pawn?.Map; if (map != null) { - var it = job.ExpandThingTargets(map); - while (it.MoveNext()) - yield return null; + if (job.cancelled == false) + { + var it = job.ExpandThingTargets(map); + while (it.MoveNext()) + { + yield return null; + didYield = true; + } + } - it = job.ExpandCellTargets(map); - while (it.MoveNext()) - yield return null; + if (job.cancelled == false) + { + var it = job.ExpandCellTargets(map); + while (it.MoveNext()) + { + yield return null; + didYield = true; + } + } - it = job.ContractTargets(map); - while (it.MoveNext()) - yield return null; + if (job.cancelled == false) + { + var it = job.ContractTargets(map); + while (it.MoveNext()) + { + yield return null; + didYield = true; + } + } } - else - yield return null; } - if (jobs.Length == 0) + if (didYield == false) yield return null; } }