-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds a WildSpawnType PrePatcher & more fixes that allows SIT to: - Run SIT without Aki Pre Patcher - Improve compatibility with Aki & Aki's own PrePatcher - Adds the PrePatcher to the build & release zip packages
- Loading branch information
Showing
7 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
SIT.WildSpawnType.PrePatcher/SIT.WildSpawnType.PrePatcher.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net471</TargetFramework> | ||
<AssemblyName>SIT.WildSpawnType.PrePatcher</AssemblyName> | ||
<Configuration>Release</Configuration> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Company>Stay In Tarkov</Company> | ||
<Copyright>Copyright @ Stay In Tarkov 2024</Copyright> | ||
<Description>Stay in Tarkov plugin for Escape From Tarkov</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="Assembly-CSharp" HintPath="..\References\Assembly-CSharp.dll" Private="False" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BepInEx.Core" Version="5.4.21" /> | ||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" ExcludeAssets="runtime" PrivateAssets="all"> | ||
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" Private="False" ExcludeAssets="runtime" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Mono.Cecil; | ||
|
||
namespace StayInTarkov | ||
{ | ||
public static class WildSpawnTypePrePatcher | ||
{ | ||
public static IEnumerable<string> TargetDLLs { get; } = new[] { "Assembly-CSharp.dll" }; | ||
|
||
public static int sptUsecValue = 47; | ||
public static int sptBearValue = 48; | ||
|
||
public static void Patch(ref AssemblyDefinition assembly) | ||
{ | ||
var botEnums = assembly.MainModule.GetType("EFT.WildSpawnType"); | ||
|
||
var sptUsec = new FieldDefinition("sptUsec", | ||
FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal | FieldAttributes.HasDefault, | ||
botEnums) | ||
{ Constant = sptUsecValue }; | ||
|
||
var sptBear = new FieldDefinition("sptBear", | ||
FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal | FieldAttributes.HasDefault, | ||
botEnums) | ||
{ Constant = sptBearValue }; | ||
|
||
if(!botEnums.Fields.Any(x => x.Name == "sptUsec")) | ||
botEnums.Fields.Add(sptUsec); | ||
|
||
if(!botEnums.Fields.Any(x => x.Name == "sptBear")) | ||
botEnums.Fields.Add(sptBear); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters