Fixed angler animation events disconnecting for added fish

This commit is contained in:
coderCleric 2023-05-15 17:52:36 -06:00
parent 3bfd688e57
commit fdac1dd6e6

View File

@ -363,7 +363,7 @@ namespace NewHorizons.Builder.Props
else if(component is Shape shape) shape.enabled = true; else if(component is Shape shape) shape.enabled = true;
// If it's not a moving anglerfish make sure the anim controller is regular // If it's not a moving anglerfish make sure the anim controller is regular
else if(component is AnglerfishAnimController && component.GetComponentInParent<AnglerfishController>() == null) else if(component is AnglerfishAnimController && component.transform.parent.GetComponent<AnglerfishController>() == null) //Manual parent chain so we can find inactive
{ {
component.gameObject.AddComponent<AnglerAnimFixer>(); component.gameObject.AddComponent<AnglerAnimFixer>();
} }
@ -380,7 +380,7 @@ namespace NewHorizons.Builder.Props
public void Start() public void Start()
{ {
var angler = GetComponent<AnglerfishAnimController>(); var angler = GetComponent<AnglerfishAnimController>();
NHLogger.LogVerbose("Fixing anglerfish animation"); NHLogger.LogVerbose("Fixing anglerfish animation");
// Remove any event reference to its angler // Remove any event reference to its angler