From f111105c5fea7b1a8f5b386d68d0a681b550a6fd Mon Sep 17 00:00:00 2001 From: littensy <56808540+littensy@users.noreply.github.com> Date: Sun, 27 Aug 2023 19:39:54 -0700 Subject: [PATCH] Fix actions receiving nil instance Action callbacks were being called with 'nil' instead of an instance. This commit fixes the action buffer type and passes 'instance' to the action callback. --- src/apply.luau | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apply.luau b/src/apply.luau index 3f04eab..9bc5d25 100644 --- a/src/apply.luau +++ b/src/apply.luau @@ -14,7 +14,7 @@ type Node = graph.Node local event_buffer: { [string]: () -> () } = {} -- buffer of priority -> callback to run after events are connected -local action_buffers = {} :: { { () -> () } } +local action_buffers = {} :: { { (Instance) -> () } } setmetatable(action_buffers :: any, { __index = function(_, i: number) action_buffers[i] = {} @@ -131,7 +131,7 @@ local function apply(instance: T & Instance, properties: { [unknown]: unknown -- run buffered actions respecting their priorities for _, buffer in next, action_buffers do for _, callback in next, buffer do - callback() + callback(instance) end end