forked from CWX/CWX-mods
29 lines
965 B
C#
29 lines
965 B
C#
using Mono.Cecil;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace CWX_PrePatcher
|
|
{
|
|
public static class PrePatcher
|
|
{
|
|
public static IEnumerable<string> TargetDLLs { get; } = new[] { "Assembly-CSharp.dll" };
|
|
|
|
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 = 3 };
|
|
|
|
var sptBear = new FieldDefinition("sptBear",
|
|
FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal | FieldAttributes.HasDefault,
|
|
botEnums)
|
|
{ Constant = 5 };
|
|
|
|
botEnums.Fields.Add(sptUsec);
|
|
botEnums.Fields.Add(sptBear);
|
|
}
|
|
}
|
|
}
|