mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 00:50:44 -05:00
mid raid achievement patch no longer needed as we assign our own, added patch to fix achievements
This commit is contained in:
parent
34e84ff737
commit
5bad769a44
@ -1,25 +0,0 @@
|
||||
using System.Reflection;
|
||||
using SPT.Reflection.Patching;
|
||||
|
||||
namespace SPT.SinglePlayer.Patches.Progression
|
||||
{
|
||||
/// <summary>
|
||||
/// BSG have disabled notifications for local raids, set updateAchievements in the achievement controller to always be true
|
||||
/// This enables the achievement notifications and the client to save completed achievement data into profile.Achievements
|
||||
/// </summary>
|
||||
public class MidRaidAchievementChangePatch : ModulePatch
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return typeof(AchievementControllerClass).GetConstructors()[0];
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
private static bool PatchPrefix(ref bool updateAchievements)
|
||||
{
|
||||
updateAchievements = true;
|
||||
|
||||
return true; // Do original method
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
using System.Reflection;
|
||||
using EFT;
|
||||
using HarmonyLib;
|
||||
using SPT.Reflection.Patching;
|
||||
using SPT.Reflection.Utils;
|
||||
|
||||
namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
{
|
||||
public class FixAchievementsPatch : ModulePatch
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(Player), nameof(Player.Init));
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
public static void PatchPostfix(Profile profile, InventoryControllerClass inventoryController, ref AbstractAchievementControllerClass ____achievementsController, ref AbstractQuestControllerClass ____questController)
|
||||
{
|
||||
var achievementController = new GClass3233(profile, inventoryController, PatchConstants.BackEndSession, true);
|
||||
achievementController.Init();
|
||||
achievementController.Run();
|
||||
|
||||
____achievementsController = achievementController;
|
||||
}
|
||||
}
|
||||
}
|
@ -58,7 +58,6 @@ namespace SPT.SinglePlayer
|
||||
new MapReadyButtonPatch().Enable();
|
||||
new LabsKeycardRemovalPatch().Enable();
|
||||
new ScavLateStartPatch().Enable();
|
||||
new MidRaidAchievementChangePatch().Enable();
|
||||
new GetTraderServicesPatch().Enable();
|
||||
new PurchaseTraderServicePatch().Enable();
|
||||
new ScavSellAllPriceStorePatch().Enable();
|
||||
@ -69,6 +68,7 @@ namespace SPT.SinglePlayer
|
||||
new ScavRepAdjustmentPatch().Enable();
|
||||
new AmmoUsedCounterPatch().Enable();
|
||||
new ArmorDamageCounterPatch().Enable();
|
||||
new FixAchievementsPatch().Enable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user