From 1d42f6b54367197348181d07a979e07fbc720953 Mon Sep 17 00:00:00 2001 From: Snirozu Date: Fri, 17 Nov 2023 21:28:02 +0100 Subject: [PATCH] dum --- source/online/Waiter.hx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/online/Waiter.hx b/source/online/Waiter.hx index a4e07203..b9dc5b77 100644 --- a/source/online/Waiter.hx +++ b/source/online/Waiter.hx @@ -5,6 +5,7 @@ import flixel.FlxBasic; //thread safe function handler class Waiter extends FlxBasic { public static var queue:ArrayVoid> = []; + var _queueItem:Void->Void; public static function put(func:Void->Void) { queue.push(func); @@ -13,10 +14,12 @@ class Waiter extends FlxBasic { override function update(elapsed) { super.update(elapsed); - for (_ in queue) { - if (queue.shift() != null) { - _(); - }; + while (queue.length > 0) { + _queueItem = queue.shift(); + + if (_queueItem != null) { + _queueItem(); + } } } } \ No newline at end of file