Skip to content

Commit

Permalink
1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
DaXcess committed Feb 3, 2024
1 parent 25d42c0 commit 610e7ad
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.1.9

**Bug fixes:**

- Fixed helmet (and volumetric plane) positioning after death

# 1.1.8

**Bug fixes:**
Expand Down
2 changes: 1 addition & 1 deletion LCVR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>LCVR</AssemblyName>
<Description>Collecting Scrap in VR</Description>
<Version>1.1.8</Version>
<Version>1.1.9</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12.0</LangVersion>
<Title>LethalCompanyVR</Title>
Expand Down
2 changes: 1 addition & 1 deletion LCVR/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Plugin : BaseUnityPlugin
{
public const string PLUGIN_GUID = "io.daxcess.lcvr";
public const string PLUGIN_NAME = "LCVR";
public const string PLUGIN_VERSION = "1.1.8";
public const string PLUGIN_VERSION = "1.1.9";

private readonly string[] GAME_ASSEMBLY_HASHES = [
"AAC6149C355A19865C0F67FD0C1D7111D4F418EF94D700265B591665B4CDCE73", // V45
Expand Down
19 changes: 19 additions & 0 deletions Patches/PlayerControllerPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,25 @@ private static IEnumerable<CodeInstruction> PatchOnDisable(IEnumerable<CodeInstr
return codes.AsEnumerable();
}

[HarmonyPatch(typeof(PlayerControllerB), nameof(PlayerControllerB.KillPlayer))]
[HarmonyTranspiler]
private static IEnumerable<CodeInstruction> PatchKillPlayer(IEnumerable<CodeInstruction> instructions)
{
var codes = new List<CodeInstruction>(instructions);

// Fix visor being repositioned on death
var startIndex = codes.FindIndex(code => code.opcode == OpCodes.Ldfld && code.operand == (object)Field(typeof(PlayerControllerB), nameof(PlayerControllerB.localVisor))) - 1;
var endIndex = startIndex + 6;

for (var i = startIndex; i <= endIndex; i++)
{
codes[i].opcode = OpCodes.Nop;
codes[i].operand = null;
}

return codes.AsEnumerable();
}

/// <summary>
/// Adds an arbitrary deadzone since the ScrollMouse gets performed if you only even touch the joystick a little bit
/// </summary>
Expand Down

0 comments on commit 610e7ad

Please sign in to comment.