mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 21:10:45 -05:00
Fix patches
This commit is contained in:
parent
85da3e405d
commit
2dfc019b21
@ -20,9 +20,9 @@ namespace SPT.Custom.Patches
|
||||
/// Needed to ensure bot checks the enemy side, not just its botType
|
||||
/// </summary>
|
||||
[PatchPrefix]
|
||||
public static bool PatchPrefix(ref bool __result, BotsGroup __instance, IPlayer requester)
|
||||
public static bool PatchPrefix(ref bool __result, BotsGroup __instance, IPlayer player)
|
||||
{
|
||||
if (requester == null)
|
||||
if (player == null)
|
||||
{
|
||||
__result = false;
|
||||
|
||||
@ -44,7 +44,7 @@ namespace SPT.Custom.Patches
|
||||
|
||||
// Check existing enemies list
|
||||
// Could also check x.Value.Player?.Id - BSG do it this way
|
||||
if (!__instance.Enemies.IsNullOrEmpty() && __instance.Enemies.Any(x => x.Key.Id == requester.Id))
|
||||
if (!__instance.Enemies.IsNullOrEmpty() && __instance.Enemies.Any(x => x.Key.Id == player.Id))
|
||||
{
|
||||
__result = true;
|
||||
return false; // Skip original
|
||||
@ -59,25 +59,25 @@ namespace SPT.Custom.Patches
|
||||
|
||||
if (__instance.Side == EPlayerSide.Usec)
|
||||
{
|
||||
if (requester.Side == EPlayerSide.Bear || requester.Side == EPlayerSide.Savage ||
|
||||
ShouldAttackUsec(requester))
|
||||
if (player.Side == EPlayerSide.Bear || player.Side == EPlayerSide.Savage ||
|
||||
ShouldAttackUsec(player))
|
||||
{
|
||||
isEnemy = true;
|
||||
__instance.AddEnemy(requester, EBotEnemyCause.checkAddTODO);
|
||||
__instance.AddEnemy(player, EBotEnemyCause.checkAddTODO);
|
||||
}
|
||||
}
|
||||
else if (__instance.Side == EPlayerSide.Bear)
|
||||
{
|
||||
if (requester.Side == EPlayerSide.Usec || requester.Side == EPlayerSide.Savage ||
|
||||
ShouldAttackBear(requester))
|
||||
if (player.Side == EPlayerSide.Usec || player.Side == EPlayerSide.Savage ||
|
||||
ShouldAttackBear(player))
|
||||
{
|
||||
isEnemy = true;
|
||||
__instance.AddEnemy(requester, EBotEnemyCause.checkAddTODO);
|
||||
__instance.AddEnemy(player, EBotEnemyCause.checkAddTODO);
|
||||
}
|
||||
}
|
||||
else if (__instance.Side == EPlayerSide.Savage)
|
||||
{
|
||||
if (requester.Side != EPlayerSide.Savage)
|
||||
if (player.Side != EPlayerSide.Savage)
|
||||
{
|
||||
//Lets exUsec warn Usecs and fire at will at Bears
|
||||
if (__instance.InitialBotType == WildSpawnType.exUsec)
|
||||
@ -86,7 +86,7 @@ namespace SPT.Custom.Patches
|
||||
}
|
||||
// everyone else is an enemy to savage (scavs)
|
||||
isEnemy = true;
|
||||
__instance.AddEnemy(requester, EBotEnemyCause.checkAddTODO);
|
||||
__instance.AddEnemy(player, EBotEnemyCause.checkAddTODO);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
using EFT.InventoryLogic.BackendInventoryInteraction;
|
||||
using EFT;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SPT.SinglePlayer.Models.ScavMode
|
||||
|
@ -25,7 +25,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
|
||||
if (damageInfo.Weapon is Weapon)
|
||||
{
|
||||
if (!Singleton<ItemFactory>.Instance.ItemTemplates.TryGetValue(damageInfo.SourceId, out var template))
|
||||
if (!Singleton<ItemFactoryClass>.Instance.ItemTemplates.TryGetValue(damageInfo.SourceId, out var template))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(MerchantsList.Class2719), nameof(MerchantsList.Class2719.method_0));
|
||||
return AccessTools.Method(typeof(MerchantsList.Class2758), nameof(MerchantsList.Class2758.method_0));
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
|
@ -8,7 +8,7 @@ namespace SPT.SinglePlayer.Patches.MainMenu
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(GClass1850), nameof(GClass1850.GetBoolForProfile));
|
||||
return AccessTools.Method(typeof(GClass1924), nameof(GClass1924.GetBoolForProfile));
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
|
@ -4,6 +4,7 @@ using SPT.Reflection.Patching;
|
||||
using Comfort.Common;
|
||||
using EFT;
|
||||
using HarmonyLib;
|
||||
using EFT.InventoryLogic;
|
||||
|
||||
namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
{
|
||||
@ -42,8 +43,8 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
||||
return;
|
||||
}
|
||||
|
||||
var inventoryController = Traverse.Create(player).Field<InventoryControllerClass>("_inventoryController").Value;
|
||||
InteractionsHandlerClass.Remove(accessCardItem, inventoryController, false, true);
|
||||
var inventoryController = Traverse.Create(player).Field<InventoryController>("_inventoryController").Value;
|
||||
InteractionsHandlerClass.Remove(accessCardItem, inventoryController);
|
||||
}
|
||||
}
|
||||
}
|
@ -52,7 +52,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
session.AllProfiles.First(x => x.Side != EPlayerSide.Savage),
|
||||
profile
|
||||
};
|
||||
session.ProfileOfPet.UncoverAll();
|
||||
session.ProfileOfPet.LearnAll();
|
||||
|
||||
// make a request to the server, so it knows of the items we might transfer
|
||||
RequestHandler.PutJson("/raid/profile/scavsave", new
|
||||
|
@ -40,7 +40,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
// Extra check to ensure we only set playerscavs to IsAI = false
|
||||
if (killedPlayerSettings.Role == WildSpawnType.assault && killedBot.Profile.Nickname.Contains("("))
|
||||
{
|
||||
killedBot.AIData.IsAI = false;
|
||||
//killedBot.AIData.IsAI = false;
|
||||
}
|
||||
|
||||
// If Victim is a PMC and has killed a Scav or Marksman.
|
||||
@ -63,7 +63,7 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
{
|
||||
if (__state.Item1 != null)
|
||||
{
|
||||
__state.Item1.AIData.IsAI = __state.Item2;
|
||||
//__state.Item1.AIData.IsAI = __state.Item2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,11 @@
|
||||
using SPT.Reflection.Patching;
|
||||
using SPT.SinglePlayer.Models.ScavMode;
|
||||
using Comfort.Common;
|
||||
using EFT.InventoryLogic.BackendInventoryInteraction;
|
||||
using EFT.InventoryLogic;
|
||||
using HarmonyLib;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using SPT.Reflection.Utils;
|
||||
using EFT;
|
||||
|
||||
namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
{
|
||||
@ -32,16 +30,8 @@ namespace SPT.SinglePlayer.Patches.ScavMode
|
||||
public static bool PatchPrefix(ProfileEndpointFactoryAbstractClass __instance, ref Task<IResult> __result, string playerId, string petId)
|
||||
{
|
||||
// Build request with additional information
|
||||
OwnerInfo fromOwner = new OwnerInfo
|
||||
{
|
||||
Id = petId,
|
||||
Type = EOwnerType.Profile
|
||||
};
|
||||
OwnerInfo toOwner = new OwnerInfo
|
||||
{
|
||||
Id = playerId,
|
||||
Type = EOwnerType.Profile
|
||||
};
|
||||
OwnerInfo fromOwner = new OwnerInfo(petId, EOwnerType.Profile);
|
||||
OwnerInfo toOwner = new OwnerInfo(playerId, EOwnerType.Profile);
|
||||
|
||||
SellAllRequest request = new SellAllRequest
|
||||
{
|
||||
|
@ -30,6 +30,9 @@ namespace SPT.SinglePlayer
|
||||
// new ScavSellAllPriceStorePatch().Enable();
|
||||
// new ScavSellAllRequestPatch().Enable();
|
||||
|
||||
// new ArmorDamageCounterPatch().Enable();
|
||||
// new AmmoUsedCounterPatch().Enable();
|
||||
|
||||
|
||||
// Still need
|
||||
// new SmokeGrenadeFuseSoundFixPatch().Enable(); TODO: refactor as it causes exceptions to be thrown when grenade is tossed by player
|
||||
@ -41,8 +44,6 @@ namespace SPT.SinglePlayer
|
||||
new DisableReadyLocationReadyPatch().Enable();
|
||||
new BotTemplateLimitPatch().Enable();
|
||||
new LoadOfflineRaidScreenPatch().Enable();
|
||||
new AmmoUsedCounterPatch().Enable();
|
||||
new ArmorDamageCounterPatch().Enable();
|
||||
new PluginErrorNotifierPatch().Enable();
|
||||
new GetNewBotTemplatesPatch().Enable();
|
||||
new LabsKeycardRemovalPatch().Enable();
|
||||
|
Loading…
x
Reference in New Issue
Block a user