diff --git a/CommunityBugFixCollection/Contributors.cs b/CommunityBugFixCollection/Contributors.cs index de9d17b..d6171b6 100644 --- a/CommunityBugFixCollection/Contributors.cs +++ b/CommunityBugFixCollection/Contributors.cs @@ -16,5 +16,7 @@ internal static class Contributors public static string[] LeCloutPanda { get; } = ["LeCloutPanda"]; public static string[] Nytra { get; } = ["Nytra"]; + + public static string[] __Choco__ { get; } = ["__Choco__"]; } } \ No newline at end of file diff --git a/CommunityBugFixCollection/Locale/en.json b/CommunityBugFixCollection/Locale/en.json index 0163a43..faa8a9b 100644 --- a/CommunityBugFixCollection/Locale/en.json +++ b/CommunityBugFixCollection/Locale/en.json @@ -1,6 +1,6 @@ { "localeCode": "en", - "authors": [ "Banane9" ], + "authors": [ "Banane9", "__Choco__" ], "messages": { "CommunityBugFixCollection.Name": "Community Bug-Fix Collection", "CommunityBugFixCollection.Description": "This mod contains fixes for various small Resonite Issues that are still open.", @@ -34,6 +34,7 @@ "CommunityBugFixCollection.PauseAnimatorUpdates.Description": "Fixes animators updating all associated fields every frame while enabled but not playing.", "CommunityBugFixCollection.SmoothDraggables.Description": "Workaround for Sliders and Joints snapping in sessions hosted by a headless.", "CommunityBugFixCollection.StationaryGrabWorldActivation.Description": "Stops the Grab World Locomotion from moving the player with each activiation.", - "CommunityBugFixCollection.UserInspectorAsNonHost.Description": "Fixes UserInspectors not listing existing users in the session for non-host users." + "CommunityBugFixCollection.UserInspectorAsNonHost.Description": "Fixes UserInspectors not listing existing users in the session for non-host users.", + "CommunityBugFixCollection.ValueModDecimal.Description": "Adds a zero check to the Decimal ValueMod ProtoFlux node to prevent DIV/0 crashes" } -} \ No newline at end of file +} diff --git a/CommunityBugFixCollection/ValueModDecimal.cs b/CommunityBugFixCollection/ValueModDecimal.cs new file mode 100644 index 0000000..b9112a3 --- /dev/null +++ b/CommunityBugFixCollection/ValueModDecimal.cs @@ -0,0 +1,21 @@ +using Elements.Core; +using FrooxEngine; +using HarmonyLib; +using MonkeyLoader.Resonite; +using System; +using System.Collections.Generic; +using System.Text; + +namespace CommunityBugFixCollection +{ + [HarmonyPatchCategory(nameof(ValueModDecimal))] + [HarmonyPatch(typeof(Elements.Core.Coder), nameof(Elements.Core.Coder.Mod))] + internal sealed class ValueModDecimal : ResoniteMonkey + { + public override IEnumerable Authors => Contributors.__Choco__; + + public override bool CanBeDisabled => true; + + private static bool Prefix(Decimal a, Decimal b) => !Enabled || b != 0; + } +} diff --git a/README.md b/README.md index f1ee8f0..1c63c94 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ just disable them in the settings in the meantime. * References in multiple duplicated or transferred-between-worlds items breaking (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/984) * UserInspectors not listing existing users in the session for non-host users (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1964) * ProtoFlux value casts from byte to other values converting incorrectly (mono / graphical client only) (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2257) +* `ValueMod` node crashes the game when B input is set to zero or disconnected. (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2746) * Grid World grid being off-center (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2754) * Animators updating all associated fields every frame while enabled but not playing (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3480) * Direct cursor size becoming very large when snapped to an object much closer than the true cursor (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3654) @@ -72,4 +73,4 @@ The feature request issues that have been implemented in this mod will be linked If any of them have been implemented and not removed from the mod, just disable them in the settings in the meantime. -* _Copy to Clipboard_ action on any non-reference member fields in Inspectors (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/810) \ No newline at end of file +* _Copy to Clipboard_ action on any non-reference member fields in Inspectors (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/810)