Skip to content

Commit 7bc4f0f

Browse files
Fixed callback bug
1 parent ba5232d commit 7bc4f0f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

atlas_loader/atlas_loader.lua

+6-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ function M.atlas_loaded(name, atlas)
201201
M.unload_atlas(previous_factory)
202202
end
203203
M.events.trigger(M.EVENTS.ATLAS_LOADED, {atlas = atlas, name = name})
204-
handle_callback(callbacks[name], {atlas = atlas, name = name})
204+
local clb = callbacks[name]
205+
callbacks[name] = nil
206+
handle_callback(clb, {atlas = atlas, name = name})
205207
end
206208

207209
---Called when atlas unloaded
@@ -210,7 +212,9 @@ function M.atlas_unloaded(name)
210212
log("Atlas unloaded: " .. tostring(name))
211213
loaded_atlases[name] = nil
212214
M.events.trigger(M.EVENTS.ATLAS_UNLOADED, {name = name})
213-
handle_callback(callbacks[name], {name = name})
215+
local clb = callbacks[name]
216+
callbacks[name] = nil
217+
handle_callback(clb, {name = name})
214218
end
215219

216220
---Check if atlas loaded

game.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ input_method = HiddenInputField
1313

1414
[project]
1515
title = AtlasLoader
16-
version = 1.1.1
16+
version = 1.1.2
1717
dependencies#0 = https://github.com/andsve/dirtylarry/archive/refs/heads/master.zip
1818

1919
[library]

0 commit comments

Comments
 (0)