diff --git a/src/Animation/PlayerTrack.cpp b/src/Animation/PlayerTrack.cpp index 5f33539..6e02630 100644 --- a/src/Animation/PlayerTrack.cpp +++ b/src/Animation/PlayerTrack.cpp @@ -94,7 +94,7 @@ void PlayerTrack::AssignTrack(Track* track, PlayerTrackObject object) { auto& playerTrack = PlayerTrack::playerTracks[object]; auto instanceTrack = playerTrack && playerTrack.isAlive() ? playerTrack->track : nullptr; - GameObject* noodleObject = playerTrack ? playerTrack->origin->gameObject : nullptr; + if (instanceTrack && playerTrack) { instanceTrack->RemoveGameObject(playerTrack->get_gameObject()); @@ -128,6 +128,8 @@ void PlayerTrack::AssignTrack(Track* track, PlayerTrackObject object) { } } + GameObject* noodleObject = playerTrack->origin->gameObject; + // this is only used in v2 playerTrack->set_enabled(track->v2); playerTrack->track = track;