Skip to content

Commit

Permalink
Fix issue causing his to be null on HTML5 (#2985)
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric authored Dec 14, 2023
1 parent 3a5ce27 commit 211e212
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,11 @@ class FlxG
* Attempts to switch from the current game state to `nextState`.
* The state switch is successful if `switchTo()` of the current `state` returns `true`.
*/
public static inline function switchState(nextState:FlxState):Void
public static function switchState(nextState:FlxState):Void
{
final stateOnCall = FlxG.state;
// Use reflection to avoid deprecation warning on switchTo
if (Reflect.field(state, 'switchTo')(nextState))
if (Reflect.callMethod(state, Reflect.field(state, 'switchTo'), [nextState]))
{
state.startOutro(function()
{
Expand Down

0 comments on commit 211e212

Please sign in to comment.