From 3b48ef6ff59f110f579382291419bff84d789f2b Mon Sep 17 00:00:00 2001 From: LordMidas <55047920+LordMidas@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:58:06 -0400 Subject: [PATCH] fix: add create to skill and remove contains check from hookTree The contains check will cause leaf classes which do not have `create` defined to not be properly hooked by our hookTree. The solution to this is to add `create` directly to the base `skill` class and then hookTree it. --- msu/hooks/skills/skill.nut | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/msu/hooks/skills/skill.nut b/msu/hooks/skills/skill.nut index 08293817..e8dbe244 100644 --- a/msu/hooks/skills/skill.nut +++ b/msu/hooks/skills/skill.nut @@ -1,7 +1,4 @@ ::MSU.MH.hookTree("scripts/skills/skill", function(q) { - if (!q.contains("create")) - return; - q.create = @(__original) function() { if (this.m.DamageType == null) @@ -27,6 +24,12 @@ q.m.IsApplyingPreview <- false; q.m.PreviewField <- {}; + // Add create function in skill.nut which doesn't exist in vanilla + // so hookTree on skill doesn't need a `.contains("create")` check + q.create <- function() + { + } + q.isType = @() function( _t, _any = true, _only = false ) { if (_any)