Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>Level Up!</name>
<author>krafs</author>
<packageId>Krafs.LevelUp</packageId>
<modVersion>5.1.0</modVersion>
<modVersion>5.1.1</modVersion>
<description>Level up notifications!</description>
<url>https://github.com/krafs/LevelUp</url>
<modIconPath>LevelUp/Icon</modIconPath>
Expand Down
2 changes: 1 addition & 1 deletion LevelUp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.6.4488-beta" />
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.6.4518" />
<PackageReference Include="Lib.Harmony" Version="2.3.6" ExcludeAssets="runtime" />
</ItemGroup>

Expand Down
5 changes: 0 additions & 5 deletions Source/ActionMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ public sealed class ActionMaker : IExposable

internal void ExecuteActions(LevelingInfo levelingInfo)
{
if (!levelingInfo.Pawn.IsFreeColonist)
{
return;
}

foreach (LevelingAction action in actions)
{
if (action.active)
Expand Down
18 changes: 17 additions & 1 deletion Source/Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,25 @@ internal static void ApplyPatches(Harmony harmony)
}

[SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Harmony naming convention")]
private static void Prefix(out int __state, SkillRecord __instance)
private static void Prefix(out int __state, SkillRecord __instance, Pawn ___pawn)
{
if (!___pawn.IsFreeColonist)
{
__state = -1;
return;
}

__state = __instance.Level;
}

[SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Harmony naming convention")]
private static void DirtyAptitudesPostfix(int __state, SkillRecord __instance, Pawn ___pawn)
{
if (__state == -1)
{
return;
}

// DirtyAptitudes can be called on the Create Character-screen if Biotech is used,
// and either crashes or makes it impossible to move forward.
// This causes the mod to try and display notifications for a colonist when not yet in a playable program state.
Expand Down Expand Up @@ -66,6 +77,11 @@ private static void DirtyAptitudesPostfix(int __state, SkillRecord __instance, P
[SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Harmony naming convention")]
private static void LearnPostfix(int __state, SkillRecord __instance, Pawn ___pawn, bool direct)
{
if (__state == -1)
{
return;
}

int previousLevel = __state;
int currentLevel = __instance.Level;

Expand Down