Skip to content

Commit

Permalink
if there aren't any songs just execute the original gd code
Browse files Browse the repository at this point in the history
  • Loading branch information
pundang committed Jul 9, 2024
1 parent 3b1106b commit 3825daa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/SongManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "SongManager.hpp"
#include "Utils.hpp"
#include <Geode/binding/GameManager.hpp>

SongManager::SongManager() {}

Expand All @@ -17,7 +18,7 @@ void SongManager::pickRandomSong() {
if (m_songs.size() >= 1) {
m_currentSong = m_songs[Utils::randomIndex(m_songs.size())];
} else {
m_currentSong = "";
m_currentSong = GameManager::get()->getMenuMusicFile();
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ SongManager &songManager = SongManager::get();

struct GameManagerHook : Modify<GameManagerHook, GameManager> {
gd::string getMenuMusicFile() {
if (songManager.getCurrentSong().empty())
return GameManager::getMenuMusicFile();

return songManager.getCurrentSong();
}
};
Expand Down

0 comments on commit 3825daa

Please sign in to comment.