This commit is contained in:
lenheart
2024-08-04 16:22:05 +08:00
parent e161cb6c55
commit b41893c040
4 changed files with 59 additions and 58 deletions

View File

@@ -229,16 +229,6 @@ void InitSquirrel()
ReqSquirrelScript(v);
}
// 执行虚拟机Main函数
SQInteger top = sq_gettop(v); // saves the stack size before the call
sq_pushroottable(v); // pushes the global table
sq_pushstring(v, _SC("main"), -1);
if (SQ_SUCCEEDED(sq_get(v, -2)))
{ // gets the field 'foo' from the global table
sq_pushroottable(v); // push the 'this' (in this case is the global table)
sq_call(v, 1, SQFalse, SQTrue); // calls the function
}
sq_settop(v, top); // restores the original stack size
sq_pushroottable(v);
sq_pushstring(v, "sq_ReloadScript", -1);