aboutsummaryrefslogtreecommitdiffstats
path: root/Lua
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-16 13:11:13 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-16 13:11:13 +0000
commit888afc0c0fe525d0d09bf1933ee6a144f4f660e8 (patch)
tree59e8290d5a9cbdad6c95eb27e170dc9470cec3bc /Lua
parent1b2346740c8b23f56a29bcbb646266667a911f6b (diff)
downloadusdx-888afc0c0fe525d0d09bf1933ee6a144f4f660e8.tar.gz
usdx-888afc0c0fe525d0d09bf1933ee6a144f4f660e8.tar.xz
usdx-888afc0c0fe525d0d09bf1933ee6a144f4f660e8.zip
some crash prevention
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1733 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Lua')
-rw-r--r--Lua/src/lua/ULuaCore.pas14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lua/src/lua/ULuaCore.pas b/Lua/src/lua/ULuaCore.pas
index 986974bb..6ea5ecc6 100644
--- a/Lua/src/lua/ULuaCore.pas
+++ b/Lua/src/lua/ULuaCore.pas
@@ -239,16 +239,16 @@ procedure TLuaCore.BrowseDir(Dir: WideString);
I: Integer;
begin
try
- Files := Platform.DirectoryFindFiles(Dir, '.usdx', true)
+ Files := Platform.DirectoryFindFiles(Dir, '.usdx', true);
+
+ for I := 0 to High(Files) do
+ if (Files[I].IsDirectory) then
+ BrowseDir(Dir + Files[i].Name) //browse recursive
+ else if (Files[I].IsFile) then
+ LoadPlugin(Dir + Files[i].Name);
except
Log.LogError('Couldn''t deal with directory/file: ' + Dir + ' in TLuaCore.BrowseDir')
end;
-
- for I := 0 to High(Files) do
- if (Files[I].IsDirectory) then
- BrowseDir(Dir + Files[i].Name) //browse recursive
- else if (Files[I].IsFile) then
- LoadPlugin(Dir + Files[i].Name);
end;
{ tries to load filename w/ lua and creates the default