From 97d825f60917cdd869bbe05f930c2da86dcaa023 Mon Sep 17 00:00:00 2001 From: flagmaggot Date: Fri, 31 Aug 2018 11:35:46 -0400 Subject: [PATCH] Added an update method to find AIActor objects This will find those that weren't caught in the AddHook as well as spawned enemies. --- Healthbars/Healthbars.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Healthbars/Healthbars.cs b/Healthbars/Healthbars.cs index 269cdaa..dec971e 100644 --- a/Healthbars/Healthbars.cs +++ b/Healthbars/Healthbars.cs @@ -54,6 +54,17 @@ public void Start() lastHealth = parent.healthHaver.GetCurrentHealth(); } + + //this will find the enemies that get missed from the addhook including spawned enemies + public void Update() + { + foreach (AIActor t in StaticReferenceManager.AllEnemies) + { + if (t.GetComponent() == null) + t.gameObject.AddComponent(); + + } + } } public class Healthbars : ETGModule