Fixed all DKCR name generation issues

This commit is contained in:
Aruki
2017-07-05 01:10:57 -06:00
parent 6a01bf5982
commit 8b84b638ac
11 changed files with 69 additions and 15 deletions

View File

@@ -97,7 +97,7 @@ void GenerateAssetNames(CGameProject *pProj)
TString NewDir = (HasCustomDir ? It->DirectoryPath() : "Uncategorized/");
TString NewName = (HasCustomName ? It->Name() : It->ID().ToString());
It->Move(NewDir, NewName);
It->Move(NewDir, NewName, true, true);
}
#endif
@@ -131,7 +131,7 @@ void GenerateAssetNames(CGameProject *pProj)
for (TResourceIterator<eWorld> It(pStore); It; ++It)
{
// Set world name
CWorld *pWorld = (CWorld*) It->Load();
TResPtr<CWorld> pWorld = It->Load();
TString WorldName = pWorld->Name();
TString WorldDir = kWorldsRoot + WorldName + '/';
@@ -205,7 +205,7 @@ void GenerateAssetNames(CGameProject *pProj)
// Rename area stuff
CResourceEntry *pAreaEntry = pStore->FindEntry(AreaID);
ASSERT(pAreaEntry != nullptr);
if (!pAreaEntry) continue; // Some DKCR worlds reference areas that don't exist
ApplyGeneratedName(pAreaEntry, WorldMasterDir, AreaName);
CStringTable *pAreaNameTable = pWorld->AreaName(iArea);

View File

@@ -204,7 +204,7 @@ bool CVirtualDirectory::RemoveChildDirectory(CVirtualDirectory *pSubdir)
// If this is part of the resource store, delete the corresponding filesystem directory
if (mpStore && pSubdir->GetRoot() == mpStore->RootDirectory())
{
TString AbsPath = mpStore->DatabaseRootPath() + pSubdir->FullPath();
TString AbsPath = mpStore->ResourcesDir() + pSubdir->FullPath();
FileUtil::DeleteDirectory(AbsPath, true);
}
@@ -237,7 +237,10 @@ void CVirtualDirectory::RemoveEmptySubdirectories()
CVirtualDirectory *pDir = mSubdirectories[SubdirIdx];
if (pDir->IsEmpty())
{
RemoveChildDirectory(pDir);
SubdirIdx--;
}
else
pDir->RemoveEmptySubdirectories();
}