the unsorted dir has blank name

This commit is contained in:
tildearrow 2023-03-12 16:13:00 -05:00
parent d9211b2a97
commit bc95fb0181
1 changed files with 6 additions and 2 deletions

View File

@ -1588,7 +1588,7 @@ void DivEngine::checkAssetDir(std::vector<DivAssetDir>& dir, size_t entries) {
// get unsorted directory
DivAssetDir* unsortedDir=NULL;
for (DivAssetDir& i: dir) {
if (i.name=="Unsorted") {
if (i.name.empty()) {
unsortedDir=&i;
break;
}
@ -1596,7 +1596,7 @@ void DivEngine::checkAssetDir(std::vector<DivAssetDir>& dir, size_t entries) {
// create unsorted directory if it doesn't exist
if (unsortedDir==NULL) {
dir.push_back(DivAssetDir("Unsorted"));
dir.push_back(DivAssetDir(""));
unsortedDir=&(*dir.rbegin());
}
@ -2498,6 +2498,10 @@ void DivEngine::recalcChans() {
if (isInsTypePossible[i]) possibleInsTypes.push_back((DivInstrumentType)i);
}
checkAssetDir(song.insDir,song.ins.size());
checkAssetDir(song.waveDir,song.wave.size());
checkAssetDir(song.sampleDir,song.sample.size());
hasLoadedSomething=true;
}