Skip to content

Commit

Permalink
fixed issue with work mode not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
rheirman committed May 9, 2020
1 parent d6ebe03 commit 05df6ab
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
Binary file modified 1.1/Assemblies/WhatTheHack.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ protected override void PostSuccessfulApply(Pawn pawn, BodyPartRecord part, Pawn
{
pawn.skills = new Pawn_SkillTracker(pawn);
}
if(pawn.workSettings == null)
{
pawn.workSettings = new Pawn_WorkSettings(pawn);
pawn.workSettings.EnableAndInitialize();
}
Utilities.InitWorkTypesAndSkills(pawn, pawnData);
if (bill.recipe.addsHediff.GetModExtension<DefModExtension_Hediff_WorkModule>() is DefModExtension_Hediff_WorkModule modExt)
{
Expand Down
7 changes: 1 addition & 6 deletions 1.1/Source/WhatTheHack/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ public static void InitWorkTypesAndSkills(Pawn pawn, ExtendedPawnData pawnData)

if (pawn.skills != null)
{
Log.Message("a");
if (pawn.skills.GetSkill(SkillDefOf.Shooting).Level == 0)
{
pawn.skills.GetSkill(SkillDefOf.Shooting).Level = 8;
Expand All @@ -207,21 +206,17 @@ public static void InitWorkTypesAndSkills(Pawn pawn, ExtendedPawnData pawnData)
{
pawn.skills.GetSkill(SkillDefOf.Melee).Level = 4;
}
Log.Message("b");

}
if (pawn.workSettings != null)
{
Log.Message("c");
var huntingWorkType = WorkTypeDefOf.Hunting;
if(pawnData.workTypes == null)
{
Log.Message("WTHACK: " + pawn.Name);
// Log.Message("WTHACK: " + pawn.Name);
pawnData.workTypes = new List<WorkTypeDef>();
}
pawnData.workTypes.Add(huntingWorkType);
pawn.workSettings.SetPriority(huntingWorkType, 3);
Log.Message("d");
}
}
public static void CalcDaysOfFuel(int numMechanoids, float fuelAmount, ref float fuelConsumption, int numPlatforms, ref float daysOfFuel, StringBuilder daysOfFuelReason)
Expand Down
4 changes: 2 additions & 2 deletions About/Version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
but no minimum version will be required -->

<!-- Optional. This specifies the version of your mod for the library. Otherwise, the version of your mod's assembly will be used. -->
<overrideVersion>2.1.4</overrideVersion>
<overrideVersion>2.1.5</overrideVersion>
<!-- Optional. Use this to specify the version of HugsLib you are targeting.
See https://github.com/UnlimitedHugs/RimworldHugsLib/releases for the current version of the library.-->
<requiredLibraryVersion>5.0.0</requiredLibraryVersion>
<requiredLibraryVersion>6.0.0</requiredLibraryVersion>
</VersionData>
28 changes: 28 additions & 0 deletions News/UpdateFeatures.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,32 @@ Update notes:
What the hack should still support any mechanoid, modded or not. This includes the new Pikeman mechanoid. If you do happen to find any issues, Please report them. Don't forget to include a HugsLib log. Press ctrl+f12 after the issue occurs, or press the green share log button to get a shareable link.
</content>
</HugsLib.UpdateFeatureDef>
<HugsLib.UpdateFeatureDef ParentName="UpdateFeatureBase_WhatTheHack">
<defName>WhatTheHack_2_1_5</defName>
<assemblyVersion>2.1.5</assemblyVersion>
<content>
What the Hack is updated to version 2.1.5

Update notes:
- Fixed mechanoids not having a "work mode" button after installing a work module.
&lt;color=orange&gt;&lt;b&gt;IMPORTANT NOTE: if you currently have mechanoids with work modules installed that lack the work mode button, just uninstall and then re-install the module, that should fix it. &lt;/b&gt;&lt;/color&gt;

Changelog for previous recent updates:

v2.1.4:
- Big performance improvement.
- Fixed conflict with Save our Ship 2 related to recipes being added to mechs.

v2.1.3
- Rimworld 1.1.2609 compatibility.

v2.1.2
- Fixed incorrect maintenance threshold (was introduced last update).

v2.1.1
- Fixed various performance issues. What the Hack should run much more smoothly now. This wouldn't have been possible without Dubs Performance Analyzer, so thumbs up to him.
- Fixed not being able to uninstall upgrade modules.

</content>
</HugsLib.UpdateFeatureDef>
</Defs>

0 comments on commit 05df6ab

Please sign in to comment.