Skip to content

Commit

Permalink
Fix flushing failing
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyslam committed Jan 18, 2020
1 parent 5252b09 commit 5dffe04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion concord/world.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ function World:emit(functionName, ...)
error("bad argument #1 to 'World:emit' (String expected, got "..type(functionName)..")")
end

local shouldFlush = self.__emitSDepth == 0

self.__emitSDepth = self.__emitSDepth + 1

local listeners = self.__events[functionName]
Expand All @@ -255,7 +257,7 @@ function World:emit(functionName, ...)
local listener = listeners[i]

if (listener.system.__enabled) then
if (self.__emitSDepth == 0) then
if (shouldFlush) then
self:__flush()
end

Expand Down

0 comments on commit 5dffe04

Please sign in to comment.