Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 23, 2025

Addresses feedback from #8 where TorsoMapperFix was creating a second Harmony instance instead of reusing the main mod's instance, causing potential patch conflicts.

Changes

  • Store the main Harmony instance (com.bhaptics.resonite.fix) in TorsoMapperFix when ApplyPatches is called
  • Use the stored instance in CommonAvatarBuilderPatch.Postfix instead of creating a new one (com.nalathethird.bHapticsManager.TorsoMapper)
public static class TorsoMapperFix {
    internal static Harmony? _harmonyInstance = null;
    
    public static void ApplyPatches(Harmony harmony) {
        _harmonyInstance = harmony;  // Store for later use
        harmony.PatchAll(typeof(TorsoMapperFix));
    }
}

// In CommonAvatarBuilderPatch.Postfix:
- var harmony = new Harmony("com.nalathethird.bHapticsManager.TorsoMapper");
- ApplyTorsoMapperPatch(harmony);
+ ApplyTorsoMapperPatch(TorsoMapperFix._harmonyInstance);

All patches now share the same Harmony instance.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 23, 2025 03:40
Co-authored-by: nalathethird <36301692+nalathethird@users.noreply.github.com>
Co-authored-by: nalathethird <36301692+nalathethird@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on bHapticsManager architecture refactor Fix Harmony instance conflict in TorsoMapperFix Nov 23, 2025
Copilot AI requested a review from nalathethird November 23, 2025 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants