Skip to content

Commit

Permalink
v3.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Sep 10, 2023
1 parent 93ff802 commit db8b1fa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
Binary file modified 1.4/Assemblies/AchtungMod.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions Source/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
42 changes: 30 additions & 12 deletions Source/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit db8b1fa

Please sign in to comment.