mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
* BugFix: Fix the data:/ VFS not being mounted if the root directory didn't already exist.
This commit is contained in:
parent
93a4f8780c
commit
59cf242a7a
1 changed files with 8 additions and 5 deletions
|
|
@ -59,15 +59,18 @@ bool MountDefaults()
|
||||||
|
|
||||||
// Always mount the data dir so scripts work in either configuration. This is used for eg. preferences storage.
|
// Always mount the data dir so scripts work in either configuration. This is used for eg. preferences storage.
|
||||||
Path dataDirectory = Platform::getUserDataDirectory();
|
Path dataDirectory = Platform::getUserDataDirectory();
|
||||||
Path appDataDirectory;
|
Path appDataDirectory = Path::Join(dataDirectory.getFullPath().c_str(), '/', TORQUE_APP_NAME);
|
||||||
appDataDirectory.setPath(dataDirectory.getFileName());
|
|
||||||
dataDirectory.appendPath(appDataDirectory);
|
|
||||||
|
|
||||||
dataDirectory.setFileName(TORQUE_APP_NAME);
|
// Ensure the root of the data directory exists before trying to mount data VFS
|
||||||
|
if (!Platform::FS::IsDirectory(appDataDirectory) && !Platform::FS::CreateDirectory(appDataDirectory))
|
||||||
|
{
|
||||||
|
// NOTE: We can't Con::errorf here because it doesn't actually output by this point in execution
|
||||||
|
}
|
||||||
|
|
||||||
mounted = Mount("data", Platform::FS::createNativeFS(dataDirectory.getFullPath()));
|
mounted = Mount("data", Platform::FS::createNativeFS(appDataDirectory.getFullPath()));
|
||||||
if (!mounted)
|
if (!mounted)
|
||||||
{
|
{
|
||||||
|
// NOTE: We can't Con::errorf here because it doesn't actually output by this point in execution
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue