mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-02 12:24:11 -04:00
Fix flushing failing
This commit is contained in:
parent
5252b0901b
commit
5dffe04b72
1 changed files with 3 additions and 1 deletions
|
@ -246,6 +246,8 @@ function World:emit(functionName, ...)
|
||||||
error("bad argument #1 to 'World:emit' (String expected, got "..type(functionName)..")")
|
error("bad argument #1 to 'World:emit' (String expected, got "..type(functionName)..")")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local shouldFlush = self.__emitSDepth == 0
|
||||||
|
|
||||||
self.__emitSDepth = self.__emitSDepth + 1
|
self.__emitSDepth = self.__emitSDepth + 1
|
||||||
|
|
||||||
local listeners = self.__events[functionName]
|
local listeners = self.__events[functionName]
|
||||||
|
@ -255,7 +257,7 @@ function World:emit(functionName, ...)
|
||||||
local listener = listeners[i]
|
local listener = listeners[i]
|
||||||
|
|
||||||
if (listener.system.__enabled) then
|
if (listener.system.__enabled) then
|
||||||
if (self.__emitSDepth == 0) then
|
if (shouldFlush) then
|
||||||
self:__flush()
|
self:__flush()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue