diff -r 1ebb27f31a71 -r 9034b80fdbdb src/squirrel_std.cpp --- a/src/squirrel_std.cpp Mon May 19 22:28:27 2008 +0000 +++ b/src/squirrel_std.cpp Tue May 20 13:09:34 2008 +0000 @@ -1,6 +1,5 @@ #include -#include #include "stdafx.h" #include "debug.h" #include "squirrel.hpp" @@ -47,21 +46,13 @@ real_filename = ReallocT(real_filename, scstrlen(real_filename) + scstrlen(filename) + 1); scstrcat(real_filename, filename); - /* Make sure we are in the root-table, so everything is included in the root-level */ - sq_pushroottable(vm); - - SQInteger ret = 0; + bool ret = Squirrel::LoadScript(vm, FS2OTTD(real_filename)); - /* Compile and load the file */ - if (!SQ_SUCCEEDED(sqstd_dofile(vm, real_filename, SQFalse, SQTrue))) { - DEBUG(misc, 0, "[squirrel] Failed to compile '%s'", filename); - ret = SQ_ERROR; - } /* Reset the top, so the stack stays correct */ sq_settop(vm, top); free(real_filename); - return ret; + return ret ? 0: SQ_ERROR; } void squirrel_register_global_std(Squirrel *engine)