diff --git a/1.4/Assemblies/PrisonLabor.dll b/1.4/Assemblies/PrisonLabor.dll index efc5416..cdbb826 100644 Binary files a/1.4/Assemblies/PrisonLabor.dll and b/1.4/Assemblies/PrisonLabor.dll differ diff --git a/1.4/CashRegistry/Assemblies/PrisonLaborCashRegistryCompatibility.dll b/1.4/CashRegistry/Assemblies/PrisonLaborCashRegistryCompatibility.dll index 4de38e2..dff6738 100644 Binary files a/1.4/CashRegistry/Assemblies/PrisonLaborCashRegistryCompatibility.dll and b/1.4/CashRegistry/Assemblies/PrisonLaborCashRegistryCompatibility.dll differ diff --git a/1.4/CleaningArea/Assemblies/PrisonLaborCleaningAreaCompatibility.dll b/1.4/CleaningArea/Assemblies/PrisonLaborCleaningAreaCompatibility.dll index 0575a34..2a55688 100644 Binary files a/1.4/CleaningArea/Assemblies/PrisonLaborCleaningAreaCompatibility.dll and b/1.4/CleaningArea/Assemblies/PrisonLaborCleaningAreaCompatibility.dll differ diff --git a/1.4/Hospitality/Assemblies/PrisonLaborHospitalityCompatibility.dll b/1.4/Hospitality/Assemblies/PrisonLaborHospitalityCompatibility.dll index 65dea12..e020342 100644 Binary files a/1.4/Hospitality/Assemblies/PrisonLaborHospitalityCompatibility.dll and b/1.4/Hospitality/Assemblies/PrisonLaborHospitalityCompatibility.dll differ diff --git a/1.4/Kijin/Assemblies/PrisonLaborKijinCompatibility.dll b/1.4/Kijin/Assemblies/PrisonLaborKijinCompatibility.dll index ea35f53..1a8430d 100644 Binary files a/1.4/Kijin/Assemblies/PrisonLaborKijinCompatibility.dll and b/1.4/Kijin/Assemblies/PrisonLaborKijinCompatibility.dll differ diff --git a/1.4/Quarry/Assemblies/PrisonLaborQuarryCompatibility.dll b/1.4/Quarry/Assemblies/PrisonLaborQuarryCompatibility.dll index 246b4e9..07a27e5 100644 Binary files a/1.4/Quarry/Assemblies/PrisonLaborQuarryCompatibility.dll and b/1.4/Quarry/Assemblies/PrisonLaborQuarryCompatibility.dll differ diff --git a/1.4/Therapy/Assemblies/PrisonLaborTherapyCompatibility.dll b/1.4/Therapy/Assemblies/PrisonLaborTherapyCompatibility.dll index 30de21f..b8279c9 100644 Binary files a/1.4/Therapy/Assemblies/PrisonLaborTherapyCompatibility.dll and b/1.4/Therapy/Assemblies/PrisonLaborTherapyCompatibility.dll differ diff --git a/About/About.xml b/About/About.xml index e7eed5d..d539464 100644 --- a/About/About.xml +++ b/About/About.xml @@ -34,7 +34,7 @@ - Version 1.4.1 + Version 1.4.2 This mod force prisoners to work. To enable this feature prisoners must have "Force to work" option checked ("Prisoner" tab). Prison labor needs management that consist: - Motivation - prisoners need to be motivated by presence of colonists. Wardens have new job - supervising prisoners. Low motivation can lead to revolts. diff --git a/README.md b/README.md index 489d5e8..369999e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

- v1.4.1 + v1.4.2

diff --git a/Source/Core/Meta/Version.cs b/Source/Core/Meta/Version.cs index 4fcd595..4f863e6 100644 --- a/Source/Core/Meta/Version.cs +++ b/Source/Core/Meta/Version.cs @@ -81,6 +81,7 @@ public enum Version v1_3_10, v1_3_11, v1_4_0, - v1_4_1 + v1_4_1, + v1_4_2 } } diff --git a/Source/Core/Meta/VersionUtility.cs b/Source/Core/Meta/VersionUtility.cs index a24fd99..0ddd2e2 100644 --- a/Source/Core/Meta/VersionUtility.cs +++ b/Source/Core/Meta/VersionUtility.cs @@ -5,8 +5,8 @@ namespace PrisonLabor.Core.Meta { public class VersionUtility { - public const Version versionNumber = Version.v1_4_1; - public const string versionString = "1.4.1"; + public const Version versionNumber = Version.v1_4_2; + public const string versionString = "1.4.2"; public static Version VersionOfSaveFile { get; set; } diff --git a/Source/Core/Recreation/RecreationUtils.cs b/Source/Core/Recreation/RecreationUtils.cs index f432cfc..2f32042 100644 --- a/Source/Core/Recreation/RecreationUtils.cs +++ b/Source/Core/Recreation/RecreationUtils.cs @@ -7,6 +7,7 @@ using Verse.AI; using Verse; using PrisonLabor.Core.Needs; +using PrisonLabor.Core.Other; namespace PrisonLabor.Core.Recreation { @@ -28,18 +29,19 @@ public static bool PrisonerJoyTickCheckEnd(Pawn pawn, JoyTickFullJoyAction fullJ } extraJoyGainFactor *= joySource.GetStatValue(StatDefOf.JoyGainFactor); } - Need need = GetPrisonerNeed(pawn); - if (need == null && !curJob.doUntilGatheringEnded) + Need treatment = pawn.needs.TryGetNeed(); + + if (treatment == null && pawn.needs.joy == null && !curJob.doUntilGatheringEnded ) { pawn.jobs.curDriver.EndJobWith(JobCondition.InterruptForced); + DebugLogger.debug("[PL] Both need null. Returning false."); return false; } - if (pawn.needs.joy != null && curJob.doUntilGatheringEnded) - { - //if somehow prisoner has joy need by other mods. - pawn.needs.joy?.GainJoy(extraJoyGainFactor * curJob.def.joyGainRate * 0.36f / 2500f, curJob.def.joyKind); - } + + //if somehow prisoner has joy need by other mods. + pawn.needs.joy?.GainJoy(extraJoyGainFactor * curJob.def.joyGainRate * 0.36f / 2500f, curJob.def.joyKind); + if (curJob.def.joySkill != null) @@ -51,7 +53,7 @@ public static bool PrisonerJoyTickCheckEnd(Pawn pawn, JoyTickFullJoyAction fullJ pawn.jobs.curDriver.EndJobWith(JobCondition.InterruptForced); return true; } - if (need.CurLevel > 0.9999f && !curJob.doUntilGatheringEnded) + if ((NeedLevelFull(treatment) || NeedLevelFull(pawn.needs.joy)) && !curJob.doUntilGatheringEnded) { switch (fullJoyAction) { @@ -66,14 +68,9 @@ public static bool PrisonerJoyTickCheckEnd(Pawn pawn, JoyTickFullJoyAction fullJ return false; } - private static Need GetPrisonerNeed(Pawn pawn) + private static bool NeedLevelFull(Need need) { - Need need = pawn.needs.TryGetNeed(); - if (need == null) - { - need = pawn.needs.TryGetNeed(); - } - return need; + return need != null && need.CurLevel > 0.9999f; } } } diff --git a/Source/Organizer/NewsFeed.xml b/Source/Organizer/NewsFeed.xml index 5d8768e..83840ea 100644 --- a/Source/Organizer/NewsFeed.xml +++ b/Source/Organizer/NewsFeed.xml @@ -4,6 +4,7 @@ + Prison Labor v 1.4.1 diff --git a/changelog.txt b/changelog.txt index e244914..8507082 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,6 @@ Changelog: +1.4.2 +- Recreation fixes 1.4.1 - Added Work and bloodfeed interaction for biotech dlc - Added Work and hemogen farm interaction for biotech dlc