Skip to content

Commit

Permalink
Let modules interact on destroy and fixed PlayState transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
PurSnake committed Sep 7, 2024
1 parent e240292 commit bc6e31d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/funkin/modding/module/ModuleHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class ModuleHandler
for (key => value in moduleCache)
{
ScriptEventDispatcher.callEvent(value, event);
moduleCache.remove(key);
//moduleCache.remove(key); let me save some stats from each other modules
}

moduleCache.clear();
Expand Down
7 changes: 5 additions & 2 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,7 @@ class PlayState extends MusicBeatSubState
{
super();

FlxTransitionableState.skipNextTransIn = (lastParams != null);
if (lastParams == null) deathCounter = 0;
//FlxTransitionableState.skipNextTransOut = false;

//lastParams

Expand Down Expand Up @@ -660,6 +658,9 @@ class PlayState extends MusicBeatSubState
overrideMusic = params.overrideMusic ?? false;
previousCameraFollowPoint = params.cameraFollowPoint;

FlxTransitionableState.skipNextTransIn = (params.cameraFollowPoint != null);
//FlxTransitionableState.skipNextTransOut = false;

// Don't do anything else here! Wait until create() when we attach to the camera.
}

Expand Down Expand Up @@ -1528,6 +1529,7 @@ class PlayState extends MusicBeatSubState
performCleanup();

super.destroy();
//lastParams = null;
}

/**
Expand Down Expand Up @@ -2989,6 +2991,7 @@ class PlayState extends MusicBeatSubState
targetVariation: currentVariation,
cameraFollowPoint: cameraFollowPoint.getPosition(),
});

}
}
}
Expand Down

0 comments on commit bc6e31d

Please sign in to comment.