From 0accfebdcdcbc1a18b100d3e37f041e16ce8bada Mon Sep 17 00:00:00 2001 From: Cuh4 <89425262+Cuh4@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:48:02 +0100 Subject: [PATCH] Release - 1.8.3 --- _build/Noir.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_build/Noir.lua b/_build/Noir.lua index fe0a312..937ea39 100644 --- a/_build/Noir.lua +++ b/_build/Noir.lua @@ -3860,7 +3860,6 @@ function Noir.Callbacks:_InstantiateCallback(name, hideStartWarning) -- For later local event = Noir.Callbacks.Events[name] - local eventAlreadyExists = event ~= nil -- If the event already exists, _ENV[name] will also exist unless the user does something stupid - but that's on them -- Create event if it doesn't exist if not event then @@ -3868,10 +3867,15 @@ function Noir.Callbacks:_InstantiateCallback(name, hideStartWarning) self.Events[name] = event end + -- Stop here if the event already exists + if event then + return event + end + -- Create function for game callback if it doesn't exist. If the user created the callback themselves, overwrite it local existing = _ENV[name] - if existing and not eventAlreadyExists then + if existing then -- Inform developer that a function for a game callback already exists Noir.Libraries.Logging:Warning("Callbacks", "Your addon has a function for the game callback '%s'. Noir will wrap around it to prevent overwriting. Please use `Noir.Callbacks:Connect(\"%s\", function(...) end)` instead of `function %s(...) end` function to avoid this warning.", name, name, name) @@ -3880,7 +3884,7 @@ function Noir.Callbacks:_InstantiateCallback(name, hideStartWarning) existing(...) event:Fire(...) end - elseif not eventAlreadyExists then + else -- Create function for game callback _ENV[name] = function(...) event:Fire(...) @@ -4058,7 +4062,7 @@ end The current version of Noir.
Follows [Semantic Versioning.](https://semver.org) ]] -Noir.Version = "1.8.2" +Noir.Version = "1.8.3" --[[ This event is called when the framework is started.