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