Skip to content

Commit

Permalink
Pool upkeep (#409)
Browse files Browse the repository at this point in the history
* upkeep for new FlxPool constructor

* use version()
  • Loading branch information
Geokureli authored Oct 17, 2023
1 parent b9dedb4 commit a9f4f8e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flixel/addons/util/FlxFSM.hx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ class FlxFSM<T> implements IFlxDestroyable

if (newName != null && !pools.exists(newName))
{
pools.set(newName, new FlxPool<FlxFSMState<T>>(newStateClass));
#if (flixel < version("5.4.0"))
final newStateConstructor = newStateClass;
#else
final newStateConstructor = ()->Type.createInstance(newStateClass, []);
#end
pools.set(newName, new FlxPool<FlxFSMState<T>>(newStateConstructor));
}

var returnToPool = state;
Expand Down

0 comments on commit a9f4f8e

Please sign in to comment.