diff options
Diffstat (limited to 'src/script/squirrel.cpp')
-rw-r--r-- | src/script/squirrel.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 837e86987..9388c45b4 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -440,13 +440,19 @@ static SQInteger _io_file_read(SQUserPointer file, SQUserPointer buf, SQInteger SQRESULT Squirrel::LoadFile(HSQUIRRELVM vm, const char *filename, SQBool printerror) { size_t size; - FILE *file = FioFOpenFile(filename, "rb", AI_DIR, &size); - if (file == NULL) file = FioFOpenFile(filename, "rb", AI_LIBRARY_DIR, &size); + FILE *file; SQInteger ret; unsigned short us; unsigned char uc; SQLEXREADFUNC func; + if (strncmp(this->GetAPIName(), "AI", 2) == 0) { + file = FioFOpenFile(filename, "rb", AI_DIR, &size); + if (file == NULL) file = FioFOpenFile(filename, "rb", AI_LIBRARY_DIR, &size); + } else { + NOT_REACHED(); + } + if (file != NULL) { SQFile f(file, size); ret = fread(&us, 1, sizeof(us), file); |