diff --git a/CommunityBugFixCollection/FireBrushToolDequipEvents.cs b/CommunityBugFixCollection/FireBrushToolDequipEvents.cs new file mode 100644 index 0000000..bf3c8b3 --- /dev/null +++ b/CommunityBugFixCollection/FireBrushToolDequipEvents.cs @@ -0,0 +1,29 @@ +using FrooxEngine; +using HarmonyLib; +using MonkeyLoader.Resonite; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CommunityBugFixCollection +{ + [HarmonyPatchCategory(nameof(FireBrushToolDequipEvents))] + [HarmonyPatch(typeof(BrushTool), nameof(BrushTool.OnDequipped))] + internal sealed class FireBrushToolDequipEvents : ResoniteMonkey + { + public override bool CanBeDisabled => true; + + private static bool Prepare() => Enabled; + + private static IEnumerable Transpiler(IEnumerable instructions) + { + return new[] + { + CodeInstruction.LoadArgument(0), + CodeInstruction.Call((Tool tool) => tool.OnDequipped()) + } + .Concat(instructions); + } + } +} \ No newline at end of file