Skip to content

Commit

Permalink
v3.0.7 is compatible with RW 1.1+1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Sep 2, 2020
1 parent 1cd4309 commit 9c96a42
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>net.pardeike.rimworld.mod.achtung</identifier>
<version>3.0.6.0</version>
<version>3.0.7.0</version>
<targetVersions>
<li>1.0.0</li>
<li>1.1.0</li>
Expand Down
2 changes: 1 addition & 1 deletion About/ModSync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ModSyncNinjaData>
<ID>be673269-db56-463b-8c36-e074881e0d77</ID>
<ModName>Achtung!</ModName>
<Version>3.0.6.0</Version>
<Version>3.0.7.0</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Github">
<Owner>pardeike</Owner>
Expand Down
Binary file modified Current/Assemblies/AchtungMod.dll
Binary file not shown.
21 changes: 14 additions & 7 deletions Source/ForcedJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,14 @@ public void UpdateCells()
addedThings.AddRange(newThings.Where(HasJob).ToList()); // keep termination with 'ToList()' here
}
while (count < addedThings.Count());
things = things.Where(thing => thing.Spawned).Where(HasJob).Union(addedThings.Except(things));
targets = new HashSet<ForcedTarget>(things.Select(thing =>
{
var item = new LocalTargetInfo(thing);
return new ForcedTarget(item, MaterialScore(item));
}));
targets = things
.Where(thing => thing.Spawned && HasJob(thing))
.Union(addedThings.Except(things))
.Select(thing =>
{
var item = new LocalTargetInfo(thing);
return new ForcedTarget(item, MaterialScore(item));
}).ToHashSet();

return;
}
Expand Down Expand Up @@ -384,7 +386,12 @@ public void ExposeData()

public bool Equals(ForcedTarget other)
{
return item.Equals(other.item);
return item == other.item;
}

public override int GetHashCode()
{
return item.GetHashCode();
}

public bool IsValidTarget()
Expand Down
4 changes: 2 additions & 2 deletions Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

[assembly: Guid("8bd5a28f-96c4-43b4-907f-600aa0162f84")]

[assembly: AssemblyVersion("3.0.6.0")]
[assembly: AssemblyFileVersion("3.0.6.0")]
[assembly: AssemblyVersion("3.0.7.0")]
[assembly: AssemblyFileVersion("3.0.7.0")]
6 changes: 4 additions & 2 deletions Source/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UnityEngine;
using HarmonyLib;
using UnityEngine;
using Verse;

namespace AchtungMod
Expand Down Expand Up @@ -71,6 +72,7 @@ public override void ExposeData()
Scribe_Values.Look(ref ignoreAssignments, "ignoreAssignments", false, true);
}

static readonly AccessTools.FieldRef<Listing, float> curX = AccessTools.FieldRefAccess<Listing, float>("curX");
public static void DoWindowContents(Rect canvas)
{
var columnWidth = (canvas.width - 30) / 2 - 2;
Expand All @@ -90,7 +92,7 @@ public static void DoWindowContents(Rect canvas)
}

list.NewColumn();
list.Indent(30 - Listing.ColumnSpacing);
curX(list) += 30 - Listing.ColumnSpacing;

list.Gap(4);
list.ValueLabeled("BreakLevel", ref Achtung.Settings.breakLevel);
Expand Down

0 comments on commit 9c96a42

Please sign in to comment.