-
Notifications
You must be signed in to change notification settings - Fork 1
/
ShellPatches.cs
69 lines (60 loc) · 1.94 KB
/
ShellPatches.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using Aki.Reflection.Patching;
using EFT;
using System.Reflection;
namespace Framesaver
{
// DontSpawnShellsFiringPatch removes the spawning of spent shell casings
// when firing a gun. Very cool, but it has an expensive update cycle
// in GameWorld to clean them up.
class DontSpawnShellsFiringPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(GClass1597)?.GetMethod("method_9", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
}
[PatchPrefix]
public static bool Prefix()
{
return false;
}
}
// DontSpawnShellsJamPatch does similar to DontSpawnShellsFiringPatch, but
// removes the processing for clearing a jam.
class DontSpawnShellsJamPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(GClass1597)?.GetMethod("SpawnShellAfterJam", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
}
[PatchPrefix]
public static bool Prefix()
{
return false;
}
}
class DontSpawnShellsAtAllReallyPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(GClass1597)?.GetMethod("method_4", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
}
[PatchPrefix]
public static bool Prefix(bool __result)
{
__result = false;
return false;
}
}
class WeaponSoundPlayerDisablePatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(WeaponSoundPlayer)?.GetMethod("Update", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
}
[PatchPrefix]
public static bool Prefix()
{
return false;
}
}
}