From 2c2b6b8958b970e5c4a805a9bc8798eaa4f47020 Mon Sep 17 00:00:00 2001
From: Jaxe <42095078+Jaxe-Dev@users.noreply.github.com>
Date: Mon, 2 Mar 2020 13:20:10 +0800
Subject: [PATCH] v1.4.2
- Harmony fix
---
About/About.xml | 12 +++++++++++-
README.md | 2 +-
Source/Mod.cs | 2 +-
Source/Patch/RimWorld_FoodUtility_WillEat.cs | 4 ++--
.../Patch/Verse_PawnGenerator_GeneratePawn.cs | 19 ++++++++++++++-----
Source/PawnRules.csproj | 4 ++--
6 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/About/About.xml b/About/About.xml
index 0eb0643..737afc2 100644
--- a/About/About.xml
+++ b/About/About.xml
@@ -3,9 +3,19 @@
Jaxe.PawnRules
Pawn Rules
Jaxe
+ Mod Version: 1.4.2\n\n\nPawn Rules is a mod that allows custom rules to be assigned individually to your colonists, animals, guests and prisoners.\n\nCurrently the following rules can be applied:\n\n- Disallow certain foods\n- Disallow bonding with certain animals\n- Disallow new romances\n- Disallow constructing items that have a quality level\n\nAny of these rules can be disabled and hidden from the rules window. Rules presets and defaults can be imported and exported between games.
1.0
1.1
- Mod Version: 1.4.1\n\n\nPawn Rules is a mod that allows custom rules to be assigned individually to your colonists, animals, guests and prisoners.\n\nCurrently the following rules can be applied:\n\n- Disallow certain foods\n- Disallow bonding with certain animals\n- Disallow new romances\n- Disallow constructing items that have a quality level\n\nAny of these rules can be disabled and hidden from the rules window. Rules presets and defaults can be imported and exported between games.
+
+
+
+ brrainz.harmony
+ Harmony
+ steam://url/CommunityFilePage/2009463077
+ https://github.com/pardeike/HarmonyRimWorld/releases/latest
+
+
+
diff --git a/README.md b/README.md
index 4a0f89e..059ca5a 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# Pawn Rules
-![Mod Version](https://img.shields.io/badge/Mod_Version-1.4.1-blue.svg)
+![Mod Version](https://img.shields.io/badge/Mod_Version-1.4.2-blue.svg)
![RimWorld Version](https://img.shields.io/badge/Built_for_RimWorld-1.1-blue.svg)
![Harmony Version](https://img.shields.io/badge/Powered_by_Harmony-2.0-blue.svg)\
![Steam Subscribers](https://img.shields.io/badge/dynamic/xml.svg?label=Steam+Subscribers&query=//table/tr[2]/td[1]&colorB=blue&url=https://steamcommunity.com/sharedfiles/filedetails/%3Fid=1499843448&suffix=+total)
diff --git a/Source/Mod.cs b/Source/Mod.cs
index 9f82517..f963eaa 100644
--- a/Source/Mod.cs
+++ b/Source/Mod.cs
@@ -12,7 +12,7 @@ internal class Mod : Verse.Mod
{
public const string Id = "PawnRules";
public const string Name = "Pawn Rules";
- public const string Version = "1.4.1";
+ public const string Version = "1.4.2";
public static readonly DirectoryInfo ConfigDirectory = new DirectoryInfo(Path.Combine(GenFilePaths.ConfigFolderPath, Id));
diff --git a/Source/Patch/RimWorld_FoodUtility_WillEat.cs b/Source/Patch/RimWorld_FoodUtility_WillEat.cs
index f987e4c..978f7f9 100644
--- a/Source/Patch/RimWorld_FoodUtility_WillEat.cs
+++ b/Source/Patch/RimWorld_FoodUtility_WillEat.cs
@@ -8,9 +8,9 @@ namespace PawnRules.Patch
internal static class RimWorld_FoodUtility_WillEat
{
[HarmonyPatch(typeof(FoodUtility), "WillEat", typeof(Pawn), typeof(Thing), typeof(Pawn), typeof(bool))]
- public static class ByThing
+ private static class ByThing
{
- private static void Postfix(ref bool __result, Pawn p, Thing food, Pawn getter = null) => ByThingDef.Postfix(ref __result, p, food.def, getter);
+ public static void Postfix(ref bool __result, Pawn p, Thing food, Pawn getter = null) => ByThingDef.Postfix(ref __result, p, food.def, getter);
}
[HarmonyPatch(typeof(FoodUtility), "WillEat", typeof(Pawn), typeof(ThingDef), typeof(Pawn), typeof(bool))]
diff --git a/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs b/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs
index 80beabc..5f4fe86 100644
--- a/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs
+++ b/Source/Patch/Verse_PawnGenerator_GeneratePawn.cs
@@ -5,16 +5,25 @@
namespace PawnRules.Patch
{
- [HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", typeof(PawnKindDef), typeof(Faction))]
internal static class Verse_PawnGenerator_GeneratePawn
{
- private static void Postfix(ref Pawn __result)
+ [HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", typeof(PawnKindDef), typeof(Faction))]
+ private static class ByRequest
{
- if (!Registry.IsActive) { return; }
+ public static void Postfix(ref Pawn __result)
+ {
+ if (!Registry.IsActive) { return; }
- if ((__result == null) || ((!__result.Faction?.IsPlayer ?? false) && (!__result.HostFaction?.IsPlayer ?? false))) { return; }
+ if ((__result == null) || ((!__result.Faction?.IsPlayer ?? true) && (!__result.HostFaction?.IsPlayer ?? true))) { return; }
- Registry.GetOrDefaultRules(__result);
+ Registry.GetOrDefaultRules(__result);
+ }
+ }
+
+ [HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", typeof(PawnGenerationRequest))]
+ private static class ByOther
+ {
+ public static void Postfix(ref Pawn __result) => ByRequest.Postfix(ref __result);
}
}
}
diff --git a/Source/PawnRules.csproj b/Source/PawnRules.csproj
index 31a5446..2072905 100644
--- a/Source/PawnRules.csproj
+++ b/Source/PawnRules.csproj
@@ -26,8 +26,8 @@
1591
-
- packages\Lib.Harmony.2.0.0.5\lib\net472\0Harmony.dll
+
+ packages\Lib.Harmony.2.0.0.8\lib\net472\0Harmony.dll
..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll