2024-07-11 21:09:38 +01:00
|
|
|
|
using System.Reflection;
|
|
|
|
|
using EFT;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
using SPT.Reflection.Utils;
|
|
|
|
|
|
|
|
|
|
namespace SPT.SinglePlayer.Patches.RaidFix
|
|
|
|
|
{
|
2024-07-11 21:18:01 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Aim of this patch is just to apply the backend session to the controller and supply true to updating achievements,
|
|
|
|
|
/// the mappings for these also need fixing. 3.8.3 remaps a different class compared to 3.9.0 and 3.10.0.
|
|
|
|
|
/// </summary>
|
2024-07-11 21:09:38 +01:00
|
|
|
|
public class FixAchievementsPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return AccessTools.Method(typeof(Player), nameof(Player.Init));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
2024-07-11 21:11:14 +01:00
|
|
|
|
public static void PatchPostfix(Profile profile, InventoryControllerClass inventoryController, ref AbstractAchievementControllerClass ____achievementsController)
|
2024-07-11 21:09:38 +01:00
|
|
|
|
{
|
|
|
|
|
var achievementController = new GClass3233(profile, inventoryController, PatchConstants.BackEndSession, true);
|
|
|
|
|
achievementController.Init();
|
|
|
|
|
achievementController.Run();
|
|
|
|
|
|
|
|
|
|
____achievementsController = achievementController;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|