Skip to content

Commit 0a23123

Browse files
committed
Fixed crash if any of the mods have custom tribes
1 parent 2a4d2b2 commit 0a23123

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Managers/Main.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ private static void PurchaseManager_IsTribeUnlocked(ref bool __result, TribeType
105105
__result = (int)type >= Plugin.AUTOIDX_STARTS_FROM || __result;
106106
}
107107

108+
/// <summary>
109+
/// Patches the steam purchase manager to unlock custom content.
110+
/// </summary>
111+
[HarmonyPrefix]
112+
[HarmonyPatch(typeof(SteamPlatformPurchaseManager), nameof(SteamPlatformPurchaseManager.IsProductUnlocked))]
113+
private static bool SteamPlatformPurchaseManager_IsProductUnlocked(ref bool __result, IAPProduct iapProduct)
114+
{
115+
__result = iapProduct == null;
116+
return iapProduct != null;
117+
}
118+
108119
/// <summary>
109120
/// Patches the purchase manager to add custom tribes to the list of unlocked tribes.
110121
/// </summary>

0 commit comments

Comments
 (0)