Skip to content

Commit 103df48

Browse files
Fix for players using Epic Games store
1 parent 5d58670 commit 103df48

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

PolyTechMain.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class PolyTechMain : PolyTechMod
2323
public new const string
2424
PluginGuid = "polytech.polytechframework",
2525
PluginName = "PolyTech Framework",
26-
PluginVersion = "0.8.1";
26+
PluginVersion = "0.8.2";
2727
private static BindingList<PolyTechMod>
2828
noncheatMods = new BindingList<PolyTechMod> { },
2929
cheatMods = new BindingList<PolyTechMod> { };
@@ -837,10 +837,22 @@ private static void PatchMainAwake()
837837
ptfInstance.ptfLogger.LogMessage($"Game Started with the following Cheat mods: {cheats}");
838838
}
839839

840-
[HarmonyPatch(typeof(SteamStatsAndAchievements), "UploadLeaderboardScore")]
841-
[HarmonyPrefix]
842-
public static bool uploadSteamScorePatch(int score, bool didBreak) {
843-
return score >= leaderboardProtMin.Value;
840+
[HarmonyPatch]
841+
static class uploadSteamScorePatch
842+
{
843+
static bool Prepare()
844+
{
845+
return TargetMethod() != null;
846+
}
847+
848+
static MethodInfo TargetMethod()
849+
{
850+
return AccessTools.Method(typeof(SteamStatsAndAchievements), "UploadLeaderboardScore");
851+
}
852+
853+
static bool Prefix(int score, bool didBreak) {
854+
return score >= leaderboardProtMin.Value;
855+
}
844856
}
845857

846858
[HarmonyPatch(typeof(LeaderBoards), "UploadScoreAsync")]

0 commit comments

Comments
 (0)