mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 15:10:44 -05:00
Fixed various patch issues
This commit is contained in:
parent
39cbda1cc9
commit
22bd973bb5
@ -23,7 +23,7 @@ namespace SPT.Custom.Patches
|
||||
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(AddOfferWindow), nameof(AddOfferWindow.method_1));
|
||||
return AccessTools.Method(typeof(AddOfferWindow), nameof(AddOfferWindow.method_5));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -32,7 +32,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
_ = MatchmakerPlayerControllerClass.MAX_SCAV_COUNT; // UPDATE REFS TO THIS CLASS BELOW !!!
|
||||
|
||||
// `MatchmakerInsuranceScreen` OnShowNextScreen
|
||||
_onReadyScreenMethod = AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_45));
|
||||
_onReadyScreenMethod = AccessTools.Method(typeof(MainMenuController), nameof(MainMenuController.method_46));
|
||||
|
||||
_isLocalField = AccessTools.Field(typeof(MainMenuController), "bool_0");
|
||||
_menuControllerField = typeof(TarkovApplication).GetFields(PatchConstants.PrivateFlags).FirstOrDefault(x => x.FieldType == typeof(MainMenuController));
|
||||
|
@ -25,7 +25,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
.GetNestedTypes(PatchConstants.PublicDeclaredFlags)
|
||||
.SingleCustom(x => x.GetField("timeAndWeather") != null
|
||||
&& x.GetField("tarkovApplication_0") != null
|
||||
&& x.GetField("timeHasComeScreenController") == null
|
||||
&& x.GetField("inTransition") != null
|
||||
&& x.Name.Contains("Struct"));
|
||||
|
||||
var desiredMethod = desiredType.GetMethods(PatchConstants.PublicDeclaredFlags)
|
||||
|
@ -16,11 +16,13 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
// Struct348 - 32128
|
||||
// Struct364 - 33374
|
||||
var desiredType = typeof(TarkovApplication)
|
||||
.GetNestedTypes(PatchConstants.PublicDeclaredFlags)
|
||||
.SingleCustom(x => x.GetField("timeAndWeather") != null
|
||||
&& x.GetField("timeHasComeScreenController") != null
|
||||
&& x.Name.Contains("Struct"));
|
||||
&& x.GetField("gameWorld") != null
|
||||
&& x.GetField("metricsConfig") != null
|
||||
&& x.Name.Contains("Struct"));
|
||||
|
||||
var desiredMethod = AccessTools.Method(desiredType, "MoveNext");
|
||||
|
||||
@ -83,8 +85,8 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
|
||||
private static bool IsTargetNestedType(Type nestedType)
|
||||
{
|
||||
return nestedType.GetMethods(PatchConstants.PublicDeclaredFlags).Count() > 0 &&
|
||||
nestedType.GetFields().Length == 6 &&
|
||||
return nestedType.GetMethods(PatchConstants.PublicDeclaredFlags).Any() &&
|
||||
nestedType.GetFields().Length == 5 &&
|
||||
nestedType.GetField("savageProfile") != null &&
|
||||
nestedType.GetField("profile") != null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user