the unsorted dir has blank name

This commit is contained in:
tildearrow 2023-03-12 16:13:00 -05:00
parent d9211b2a97
commit bc95fb0181

View file

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