diff --git a/CHANGELOG.md b/CHANGELOG.md index 21b4644f..0a8920bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.1.9 + +**Bug fixes:** + +- Fixed helmet (and volumetric plane) positioning after death + # 1.1.8 **Bug fixes:** diff --git a/LCVR.csproj b/LCVR.csproj index 56397dd5..5293b672 100644 --- a/LCVR.csproj +++ b/LCVR.csproj @@ -4,7 +4,7 @@ netstandard2.1 LCVR Collecting Scrap in VR - 1.1.8 + 1.1.9 true 12.0 LethalCompanyVR diff --git a/LCVR/Plugin.cs b/LCVR/Plugin.cs index 16e2b2d1..00a8ade7 100644 --- a/LCVR/Plugin.cs +++ b/LCVR/Plugin.cs @@ -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 diff --git a/Patches/PlayerControllerPatches.cs b/Patches/PlayerControllerPatches.cs index b7e4ccf3..d5593910 100644 --- a/Patches/PlayerControllerPatches.cs +++ b/Patches/PlayerControllerPatches.cs @@ -151,6 +151,25 @@ private static IEnumerable PatchOnDisable(IEnumerable PatchKillPlayer(IEnumerable instructions) + { + var codes = new List(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(); + } + /// /// Adds an arbitrary deadzone since the ScrollMouse gets performed if you only even touch the joystick a little bit ///