diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/game/game_controller.hpp.sq | 3 | ||||
-rw-r--r-- | src/script/squirrel.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/script/api/game/game_controller.hpp.sq b/src/script/api/game/game_controller.hpp.sq index 53882fd3a..461ba52f4 100644 --- a/src/script/api/game/game_controller.hpp.sq +++ b/src/script/api/game/game_controller.hpp.sq @@ -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"); } diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index bc02be5f4..da5ed47c2 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -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(); } |