From a9f4f8e89f081153673ecfa11a94436cc121e36e Mon Sep 17 00:00:00 2001 From: George Kurelic Date: Tue, 17 Oct 2023 11:49:23 -0500 Subject: [PATCH] Pool upkeep (#409) * upkeep for new FlxPool constructor * use version() --- flixel/addons/util/FlxFSM.hx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flixel/addons/util/FlxFSM.hx b/flixel/addons/util/FlxFSM.hx index 377ede6c..c34d9a0e 100644 --- a/flixel/addons/util/FlxFSM.hx +++ b/flixel/addons/util/FlxFSM.hx @@ -128,7 +128,12 @@ class FlxFSM implements IFlxDestroyable if (newName != null && !pools.exists(newName)) { - pools.set(newName, new FlxPool>(newStateClass)); + #if (flixel < version("5.4.0")) + final newStateConstructor = newStateClass; + #else + final newStateConstructor = ()->Type.createInstance(newStateClass, []); + #end + pools.set(newName, new FlxPool>(newStateConstructor)); } var returnToPool = state;