Prevent ChildParentAudioClipPlayer component crashing the game#79
Open
Prevent ChildParentAudioClipPlayer component crashing the game#79
Conversation
Nytra
reviewed
Jan 22, 2026
Contributor
Nytra
left a comment
There was a problem hiding this comment.
It's more of a workaround than a fix
Contributor
Author
|
What would you consider fixing it? This is (similar to) how it would have to be done in vanilla too, or alternatively, failing silently when the target is bad |
Contributor
|
Something like this maybe https://discord.com/channels/901126079857692714/1418271583423697008/1421433954774552707 |
e2eefc9 to
0ffa698
Compare
0ffa698 to
a65201e
Compare
Contributor
Author
|
Ah, this fix is supposed to be for the crash caused by the ChildParentAudioClipPlayer itself - I can add your patch for the other issue, though. [HarmonyPatch(typeof(AudioOutput), "UpdateNativeOutput")]
class Patch
{
static FieldInfo _updateRegisteredField = AccessTools.Field(typeof(AudioOutput), "_updateRegistered");
static bool Prefix(AudioOutput __instance)
{
if (__instance.Slot.Parent.FilterWorldElement() is null)
{
_updateRegisteredField.SetValue(__instance, false);
return false;
}
return true;
}
} |
Contributor
Author
|
And woops, noticed a bug here still... the note appears on every component 😂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a fix for Yellow-Dog-Man/Resonite-Issues#1457
Requested in #78