Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Dec 15, 2024
1 parent 19b6908 commit d9ea5d9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CommunityBugFixCollection/Locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"authors": [ "Banane9" ],
"messages": {
"CommunityBugFixCollection.Name": "Community Bug-Fix Collection",
"CommunityBugFixCollection.Description": "This mod contains fixes for various small Resonite Issues that are still open."
"CommunityBugFixCollection.Description": "This mod contains fixes for various small Resonite Issues that are still open.",

"CommunityBugFixCollection.NoZeroScaleToolRaycast": "Fixes Resonite Issue #98: World crashes when a (multi)tool is scaled to zero."
}
}
23 changes: 23 additions & 0 deletions CommunityBugFixCollection/NoZeroScaleToolRaycast.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Elements.Core;
using FrooxEngine;
using HarmonyLib;
using MonkeyLoader.Resonite;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
[HarmonyPatch(typeof(Tool), nameof(Tool.GetHit))]
[HarmonyPatchCategory(nameof(NoZeroScaleToolRaycast))]
internal sealed class NoZeroScaleToolRaycast : ResoniteMonkey<NoZeroScaleToolRaycast>
{
public override bool CanBeDisabled => true;

private static bool Prepare() => Enabled;

[HarmonyPrefix]
private static bool GetHitPrefix(Tool __instance)
=> __instance.TipForward.IsValid() && __instance.TipForward != float3.Zero;
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ The issues fixed by this mod will be linked in the following list.
If any of them have been closed and not removed from the mod,
just disable them in the settings in the meantime.

* World crash when a (multi)tool is scaled to zero (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/98)

0 comments on commit d9ea5d9

Please sign in to comment.