From 5dffe04b7227d9874c241056980be84ef9d91ca2 Mon Sep 17 00:00:00 2001 From: Tjakka5 Date: Sat, 18 Jan 2020 19:44:09 +0100 Subject: [PATCH] Fix flushing failing --- concord/world.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/concord/world.lua b/concord/world.lua index 7708bb6..70551c0 100644 --- a/concord/world.lua +++ b/concord/world.lua @@ -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] @@ -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