Skip to content

Commit

Permalink
upkeep for new FlxPool constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed Oct 11, 2023
1 parent b9dedb4 commit be22ec2
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 < "5.4")
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 be22ec2

Please sign in to comment.