direct: don't rely on vfs being present in builtins

This commit is contained in:
rdb 2020-08-11 09:40:34 +02:00
parent 9c4cb28805
commit 8178fb21f3
3 changed files with 3 additions and 0 deletions

View File

@ -260,6 +260,7 @@ class ConnectionRepository(
searchPath = getModelPath().getValue()
for dcFileName in dcFileNames:
pathname = Filename(dcFileName)
vfs = VirtualFileSystem.getGlobalPtr()
vfs.resolveFilename(pathname, searchPath)
readResult = dcFile.read(pathname)
if not readResult:

View File

@ -225,6 +225,7 @@ class ServerRepository:
searchPath = getModelPath().getValue()
for dcFileName in dcFileNames:
pathname = Filename(dcFileName)
vfs = VirtualFileSystem.getGlobalPtr()
vfs.resolveFilename(pathname, searchPath)
readResult = dcFile.read(pathname)
if not readResult:

View File

@ -201,6 +201,7 @@ class ParticleEffect(NodePath):
f.write('self.addForceGroup(%s)\n' % target)
def loadConfig(self, filename):
vfs = VirtualFileSystem.getGlobalPtr()
data = vfs.readFile(filename, 1)
data = data.replace(b'\r', b'')
try: