(svn r23612) -Add: allow importing libraries in the same way as AI does, only with GS prefix (and in game/library)
This commit is contained in:
@@ -25,4 +25,7 @@ void SQGSController_Register(Squirrel *engine)
|
||||
SQGSController.DefSQStaticMethod(engine, &ScriptController::Print, "Print", 3, ".bs");
|
||||
|
||||
SQGSController.PostRegister(engine);
|
||||
|
||||
/* Register the import statement to the global scope */
|
||||
SQGSController.DefSQStaticMethod(engine, &ScriptController::Import, "import", 4, ".ssi");
|
||||
}
|
||||
|
@@ -451,6 +451,7 @@ SQRESULT Squirrel::LoadFile(HSQUIRRELVM vm, const char *filename, SQBool printer
|
||||
if (file == NULL) file = FioFOpenFile(filename, "rb", AI_LIBRARY_DIR, &size);
|
||||
} else if (strncmp(this->GetAPIName(), "GS", 2) == 0) {
|
||||
file = FioFOpenFile(filename, "rb", GAME_DIR, &size);
|
||||
if (file == NULL) file = FioFOpenFile(filename, "rb", GAME_LIBRARY_DIR, &size);
|
||||
} else {
|
||||
NOT_REACHED();
|
||||
}
|
||||
|
Reference in New Issue
Block a user