diff --git a/Resources/lethalcompanyvr b/Resources/lethalcompanyvr index 11871424..985f8411 100644 Binary files a/Resources/lethalcompanyvr and b/Resources/lethalcompanyvr differ diff --git a/Source/Input/RemappableControls.cs b/Source/Input/RemappableControls.cs index 0ba838fa..f29a4ae7 100644 --- a/Source/Input/RemappableControls.cs +++ b/Source/Input/RemappableControls.cs @@ -57,7 +57,9 @@ public Sprite this[string controlPath] var path = Regex.Replace(controlPath.ToLowerInvariant(), @"<[^>]+>([^ ]+)", "$1"); var hand = path.Split('/')[0].TrimStart('{').TrimEnd('}'); - controlPath = string.Join("/", path.Split('/').Skip(1)).TrimStart('{').TrimEnd('}'); + controlPath = Regex.Replace(string.Join("/", path.Split('/').Skip(1)), @"{(.*)}", "$1"); + + Logger.LogDebug(controlPath); return (hand, controlPath) switch { diff --git a/Source/Patches/PlayerControllerPatches.cs b/Source/Patches/PlayerControllerPatches.cs index 82825759..d99ee38f 100644 --- a/Source/Patches/PlayerControllerPatches.cs +++ b/Source/Patches/PlayerControllerPatches.cs @@ -360,8 +360,11 @@ private static IEnumerable DropItemWithHandRotation(IEnumerable static int GetHandRotation(PlayerControllerB player) { - var dir = VRSession.Instance.LocalPlayer.PrimaryController.InteractOrigin.forward; - return (int)(Mathf.Atan2(dir.x, dir.z) * Mathf.Rad2Deg); + var item = player.currentlyHeldObjectServer; + var restOffset = Quaternion.Euler(item.itemProperties.restingRotation.x, 0, + item.itemProperties.restingRotation.z); + return (int)(item.transform.eulerAngles.y - item.itemProperties.floorYOffset - 90 + + restOffset.eulerAngles.y); } } }