-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hurt prisoners that are not incapacitated and are set to release when…
… healthy should now be brought food, thanks MaxIssaKitsune for the detailed report!
- Loading branch information
Showing
9 changed files
with
98 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# Changelog for CustomPrisonerInteractions | ||
|
||
1.3.1 - Hurt prisoners that are not incapacitated and are set to release when healthy should now be brought food, thanks MaxIssaKitsune for the detailed report! | ||
|
||
|
||
1.3.0 - First publish | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<Manifest> | ||
<identifier>CustomPrisonerInteractions</identifier> | ||
<version>1.3.0</version> | ||
<version>1.3.1</version> | ||
<dependencies /> | ||
<incompatibleWith /> | ||
<loadBefore /> | ||
<loadAfter /> | ||
<manifestUri>https://raw.githubusercontent.com/emipa606/CustomPrisonerInteractions/master/About/Manifest.xml</manifestUri> | ||
<downloadUri>https://github.com/emipa606/CustomPrisonerInteractions/releases</downloadUri> | ||
</Manifest> | ||
</Manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2841231775 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Source/CustomPrisonerInteractions/Pawn_GuestTracker_CanBeBroughtFood.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using HarmonyLib; | ||
using RimWorld; | ||
using Verse; | ||
|
||
namespace CustomPrisonerInteractions; | ||
|
||
[HarmonyPatch(typeof(Pawn_GuestTracker), "CanBeBroughtFood", MethodType.Getter)] | ||
public static class Pawn_GuestTracker_CanBeBroughtFood | ||
{ | ||
public static void Postfix(Pawn_GuestTracker __instance, Pawn ___pawn, ref bool __result) | ||
{ | ||
if (__result) | ||
{ | ||
return; | ||
} | ||
|
||
if (__instance.interactionMode != PrisonerInteractionModeDefOf.Release) | ||
{ | ||
return; | ||
} | ||
|
||
var extraInterractionsTracker = ___pawn.Map.GetExtraInteractionsTracker(); | ||
if (extraInterractionsTracker == null || !extraInterractionsTracker.Has(___pawn)) | ||
{ | ||
return; | ||
} | ||
|
||
__result = extraInterractionsTracker[___pawn] == CustomPrisonerInteractions.ExtraMode.ReleaseWhenHealthy; | ||
} | ||
} |