From e1772727d70c1e7411b131b4894d99a815e5535f Mon Sep 17 00:00:00 2001 From: LazyTeenStudios Date: Sat, 3 May 2025 12:33:45 -0500 Subject: [PATCH 1/8] ValueMod Decimal fix added --- CommunityBugFixCollection/Contributors.cs | 2 ++ CommunityBugFixCollection/ValueModDecimal.cs | 28 ++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 CommunityBugFixCollection/ValueModDecimal.cs 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/ValueModDecimal.cs b/CommunityBugFixCollection/ValueModDecimal.cs new file mode 100644 index 0000000..24b96ed --- /dev/null +++ b/CommunityBugFixCollection/ValueModDecimal.cs @@ -0,0 +1,28 @@ +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 VarDecMod(Decimal a, Decimal b) + { + if (b == 0) + { + return false; + } + return true; + } + } +} \ No newline at end of file From be4ad5e193757c6f3aa78f0a2487dde339beecd7 Mon Sep 17 00:00:00 2001 From: Awesome_tornado_ <73045075+AwesomeTornado@users.noreply.github.com> Date: Sat, 3 May 2025 12:50:20 -0500 Subject: [PATCH 2/8] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f1ee8f0..b22b42c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ just disable them in the settings in the meantime. * 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) * Grid World floor shaking on AMD and Intel GPUs (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3829) * DuplicateSlot ProtoFlux node crashes game when if OverrideParent is identical to Template (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3950) +* ValueMod node crashes the game when B input is set to zero or disconnected. (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2746) Fixes with no issue (that could be found). * Content of notification being off-center. @@ -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) From 84d45c079a427249fd76ce2f5c709ed8cae064f7 Mon Sep 17 00:00:00 2001 From: LazyTeenStudios Date: Sat, 3 May 2025 12:52:39 -0500 Subject: [PATCH 3/8] oops, forgot to change the function name. --- CommunityBugFixCollection/ValueModDecimal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityBugFixCollection/ValueModDecimal.cs b/CommunityBugFixCollection/ValueModDecimal.cs index 24b96ed..c14640a 100644 --- a/CommunityBugFixCollection/ValueModDecimal.cs +++ b/CommunityBugFixCollection/ValueModDecimal.cs @@ -16,7 +16,7 @@ internal sealed class ValueModDecimal : ResoniteMonkey public override bool CanBeDisabled => true; - private static bool VarDecMod(Decimal a, Decimal b) + private static bool Prefix(Decimal a, Decimal b) { if (b == 0) { From bfe1b97a22657d5ee39c7b2decad9d2ad9471757 Mon Sep 17 00:00:00 2001 From: Awesome_tornado_ <73045075+AwesomeTornado@users.noreply.github.com> Date: Sat, 3 May 2025 14:36:41 -0500 Subject: [PATCH 4/8] Inline simple function --- CommunityBugFixCollection/ValueModDecimal.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/CommunityBugFixCollection/ValueModDecimal.cs b/CommunityBugFixCollection/ValueModDecimal.cs index c14640a..b9112a3 100644 --- a/CommunityBugFixCollection/ValueModDecimal.cs +++ b/CommunityBugFixCollection/ValueModDecimal.cs @@ -16,13 +16,6 @@ internal sealed class ValueModDecimal : ResoniteMonkey public override bool CanBeDisabled => true; - private static bool Prefix(Decimal a, Decimal b) - { - if (b == 0) - { - return false; - } - return true; - } + private static bool Prefix(Decimal a, Decimal b) => !Enabled || b != 0; } -} \ No newline at end of file +} From 2a66f846a3959a34fb0128813875aba9e6778d93 Mon Sep 17 00:00:00 2001 From: Awesome_tornado_ <73045075+AwesomeTornado@users.noreply.github.com> Date: Sat, 3 May 2025 14:38:39 -0500 Subject: [PATCH 5/8] Update position of fix in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b22b42c..db65518 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,12 @@ 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) * Grid World floor shaking on AMD and Intel GPUs (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3829) * DuplicateSlot ProtoFlux node crashes game when if OverrideParent is identical to Template (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3950) -* ValueMod node crashes the game when B input is set to zero or disconnected. (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2746) Fixes with no issue (that could be found). * Content of notification being off-center. From d2c4fd08503207084439280418e1a850f41e8588 Mon Sep 17 00:00:00 2001 From: Awesome_tornado_ <73045075+AwesomeTornado@users.noreply.github.com> Date: Sat, 3 May 2025 14:41:10 -0500 Subject: [PATCH 6/8] Update en.json --- CommunityBugFixCollection/Locale/en.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CommunityBugFixCollection/Locale/en.json b/CommunityBugFixCollection/Locale/en.json index 0163a43..6810b57 100644 --- a/CommunityBugFixCollection/Locale/en.json +++ b/CommunityBugFixCollection/Locale/en.json @@ -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 +} From b596e115eea941f3239c529d0f65e6363041625c Mon Sep 17 00:00:00 2001 From: Awesome_tornado_ <73045075+AwesomeTornado@users.noreply.github.com> Date: Sat, 3 May 2025 14:42:27 -0500 Subject: [PATCH 7/8] Add myself as an author --- CommunityBugFixCollection/Locale/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityBugFixCollection/Locale/en.json b/CommunityBugFixCollection/Locale/en.json index 6810b57..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.", From a6946cf8336ad12f05348818c80f5daa71c3fe04 Mon Sep 17 00:00:00 2001 From: Awesome_tornado_ <73045075+AwesomeTornado@users.noreply.github.com> Date: Sat, 3 May 2025 14:52:23 -0500 Subject: [PATCH 8/8] fix md formatting hiding \ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db65518..1c63c94 100644 --- a/README.md +++ b/README.md @@ -46,7 +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) +* `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)