Skip to content

Commit

Permalink
Update for Rimworld 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jkluch committed Feb 25, 2020
1 parent c2b4f3a commit 2e24a2b
Show file tree
Hide file tree
Showing 13 changed files with 2,479 additions and 103 deletions.
4 changes: 0 additions & 4 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
<ModMetaData>
<name>Haul to Stack</name>
<author>ItsComcastic</author>
<!--<targetVersion>1.0.0</targetVersion>-->
<supportedVersions>
<li>1.0</li>
<li>1.1</li>
</supportedVersions>
<packageId>jkluch.HaulToStack</packageId>
<description>
&lt;size=18&gt;Version 1.0.0&lt;/size&gt;
&lt;size=18&gt;This version also works with beta 19&lt;/size&gt;

&lt;size=18&gt;Features&lt;/size&gt;
Haulers will check for an existing stack to add it's item to.
Haulers no longer reserve the haul-to tile meaning multiple pawns can haul to the same tile at once.
Expand Down
Binary file added Assemblies/0Harmony.pdb
Binary file not shown.
Binary file added Assemblies/HaulToStack.pdb
Binary file not shown.
12 changes: 6 additions & 6 deletions Source/HarmonyPatches.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using Harmony;
using HarmonyLib;
using HugsLib;
using HugsLib.Utils;
using RimWorld;
Expand All @@ -19,19 +19,19 @@ public static class HarmonyPatches

static HarmonyPatches()
{
HarmonyInstance.DEBUG = true;
var harmony = HarmonyInstance.Create("com.jkluch.HaulToStack");
//Harmony.DEBUG = true;
var harmony = new Harmony("com.jkluch.HaulToStack");

harmony.Patch(
original: AccessTools.Method(typeof(JobDriver_HaulToCell), "TryMakePreToilReservations", new Type[] { typeof(bool) }),
prefix: new HarmonyMethod(type: patchType, name: nameof(PreToilReservations_Prefix)),
postfix: new HarmonyMethod(type: patchType, name: nameof(PreToilReservations_Postfix))
prefix: new HarmonyMethod(methodType: patchType, methodName: nameof(PreToilReservations_Prefix)),
postfix: new HarmonyMethod(methodType: patchType, methodName: nameof(PreToilReservations_Postfix))
);

harmony.Patch(
original: AccessTools.Method(typeof(StoreUtility), "TryFindBestBetterStoreCellForWorker"),
prefix: null,
postfix: new HarmonyMethod(type: patchType, name: nameof(TryFindBestBetterStoreCellForWorker_Postfix))
postfix: new HarmonyMethod(methodType: patchType, methodName: nameof(TryFindBestBetterStoreCellForWorker_Postfix))
);

//Add a feature to CarryHauledThingToCell so if the haul-to tile is now reserved we look for a new location
Expand Down
2 changes: 1 addition & 1 deletion Source/HaulToStack.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Harmony;
using HarmonyLib;
using HugsLib;
using HugsLib.Utils;
using RimWorld;
Expand Down
20 changes: 9 additions & 11 deletions Source/HaulToStack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HaulToStack</RootNamespace>
<AssemblyName>HaulToStack</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
Expand All @@ -34,6 +34,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.0.0.6, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.0.0.6\lib\net472\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\Rimworld Dependencies\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
Expand All @@ -42,6 +45,10 @@
<HintPath>..\..\Rimworld Dependencies\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HugsLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UnlimitedHugs.Rimworld.HugsLib.6.2.0\lib\net472\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
Expand All @@ -55,20 +62,11 @@
<Compile Include="HaulToStack.cs" />
<Compile Include="HaulUtils.cs" />
<Compile Include="JobDriver_HaulToStack.cs" />
<Compile Include="MultiVersionModFix.cs" />
<Compile Include="PlannedHauls.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Harmony\Harmony\Harmony.csproj">
<Project>{69aee16a-b6e7-4642-8081-3928b32455df}</Project>
<Name>Harmony</Name>
</ProjectReference>
<ProjectReference Include="..\..\RimworldHugsLib\HugsLib.csproj">
<Project>{a5d9bd45-533c-4ca0-9298-8950a3da724c}</Project>
<Name>HugsLib</Name>
<Private>False</Private>
</ProjectReference>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
Expand Down
81 changes: 0 additions & 81 deletions Source/MultiVersionModFix.cs

This file was deleted.

24 changes: 24 additions & 0 deletions SteamDescription.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[h1]Compatible with Versions 1.0, 1.1[/h1]

[h1]Features[/h1]
Haulers will check for an existing stack to add it's item to.
Haulers no longer reserve the haul-to tile meaning multiple pawns can haul to the same tile at once.


[h1]Issues[/h1]
You may still see your pawns haul to different stacks, this will happen under the following conditions:
[list]
[*]there are no existing stacks
[*]the existing stacks are full[/list]

Example: If you get a pod drop with new loot and two pawns pickup some before any is placed, they might pick different spots in the stockpile to haul to. I'm working on a system where they can share with eachother which tile they plan on placing new loot on which should fix that issue.

[h1]Conflicts[/h1]
It looks like there might be a conflict with a wall light mod if your stash runs against the wall light. If you have wall lights against your stash take that tile out of your stockpile zone to prevent pawns from going into a loop of trying to haul over and over. This issue isn't fixable by changing mod order unfortunately, I'll have to work with the mod creater on a solution.
This overwrites the builtin JobDriver_HaulToCell. If any other mods overwrite the JobDriver for hauling this mod will throw tile reservation errors. This mod should be compatible with most other mods but let me know if you have any problems.


Thanks to @Trips on the rimworld discord server for the Haul to Stack preview picture.

Github
https://github.com/jkluch/HaulToStack
Binary file added v1.1/Assemblies/0Harmony.dll
Binary file not shown.
Binary file added v1.1/Assemblies/0Harmony.pdb
Binary file not shown.
Loading

0 comments on commit 2e24a2b

Please sign in to comment.