mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
End conversation on attach (#367)
## Bug fixes - Fix a vanilla bug where being in a conversation and then getting attached to something traps you in dialogue.
This commit is contained in:
commit
82f5f34800
21
NewHorizons/Patches/CharacterDialogueTreePatches.cs
Normal file
21
NewHorizons/Patches/CharacterDialogueTreePatches.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace NewHorizons.Patches;
|
||||
|
||||
[HarmonyPatch]
|
||||
internal class CharacterDialogueTreePatches
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.Awake))]
|
||||
private static void CharacterDialogueTree_Awake(CharacterDialogueTree __instance)
|
||||
{
|
||||
GlobalMessenger<OWRigidbody>.AddListener("AttachPlayerToPoint", (_) => __instance.EndConversation());
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.OnDestroy))]
|
||||
private static void CharacterDialogueTree_OnDestroy(CharacterDialogueTree __instance)
|
||||
{
|
||||
GlobalMessenger<OWRigidbody>.RemoveListener("AttachPlayerToPoint", (_) => __instance.EndConversation());
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user