Skip to content

Commit

Permalink
Fix compile error with callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Jul 2, 2024
1 parent e0bf9f5 commit a60afca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Animation/PlayerTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ using namespace Animation;
// Events.cpp
extern BeatmapObjectSpawnController* spawnController;

std::unordered_map<PlayerTrackObject, SafePtrUnity<PlayerTrack>> PlayerTrack::playerTracks;

static Action* didPauseEventAction;
static Action* didResumeEventAction;

Expand Down Expand Up @@ -87,8 +89,8 @@ void PlayerTrack::AssignTrack(Track* track, PlayerTrackObject object) {
playerTrack->pauseController = Object::FindObjectOfType<PauseController*>();

if (playerTrack->pauseController) {
std::function<void()> pause = [playerTrack]() { playerTrack->OnDidPauseEvent(); };
std::function<void()> resume = [playerTrack]() { playerTrack->OnDidResumeEvent(); };
std::function<void()> pause = [playerTrack]() mutable { playerTrack->OnDidPauseEvent(); };
std::function<void()> resume = [playerTrack]() mutable { playerTrack->OnDidResumeEvent(); };
didPauseEventAction = custom_types::MakeDelegate<Action*>(pause);
playerTrack->pauseController->add_didPauseEvent(didPauseEventAction);
didResumeEventAction = custom_types::MakeDelegate<Action*>(resume);
Expand Down

0 comments on commit a60afca

Please sign in to comment.