Skip to content

Commit

Permalink
Fix issue on Duplicate/Permute about worksettings not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
aRandomKiwi committed Jul 31, 2021
1 parent 23c28c3 commit b9a28ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Binary file modified 1.3/Assemblies/AndroidTiers.dll
Binary file not shown.
Binary file modified Source/Androids For RW1.3/.vs/Androids/v15/.suo
Binary file not shown.
12 changes: 7 additions & 5 deletions Source/Androids For RW1.3/Utils/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1600,13 +1600,14 @@ public static void Duplicate(Pawn source, Pawn dest, bool overwriteAsDeath=true)
if (source.workSettings == null)
{
source.workSettings = new Pawn_WorkSettings(source);
source.workSettings.EnableAndInitializeIfNotAlreadyInitialized();
}
source.workSettings.EnableAndInitializeIfNotAlreadyInitialized();

if (dest.workSettings == null)
{
dest.workSettings = new Pawn_WorkSettings(dest);
dest.workSettings.EnableAndInitializeIfNotAlreadyInitialized();
}
dest.workSettings.EnableAndInitializeIfNotAlreadyInitialized();

if (source.workSettings != null && source.workSettings.EverWork)
{
Expand Down Expand Up @@ -1997,13 +1998,14 @@ public static void PermutePawn(Pawn p1, Pawn p2, bool allowSettingsPermutation=t
if (p1.workSettings == null)
{
p1.workSettings = new Pawn_WorkSettings(p1);
p1.workSettings.EnableAndInitializeIfNotAlreadyInitialized();
}
p1.workSettings.EnableAndInitializeIfNotAlreadyInitialized();

if (p2.workSettings == null) {
if (p2.workSettings == null)
{
p2.workSettings = new Pawn_WorkSettings(p2);
p2.workSettings.EnableAndInitializeIfNotAlreadyInitialized();
}
p2.workSettings.EnableAndInitializeIfNotAlreadyInitialized();

/*************************************** PERMUTATION of Settings,restrictions********************************/
if (allowSettingsPermutation && p1.Faction == Faction.OfPlayer && p2.Faction == Faction.OfPlayer)
Expand Down
Binary file modified Source/Androids For RW1.3/obj/Debug/AndroidTiers.dll
Binary file not shown.

0 comments on commit b9a28ff

Please sign in to comment.