Exemplo n.º 1
0
        public IList <object> RunScript(string script)
        {
            if (Disposed)
            {
                return(null);
            }
            Script = script;
            var luaState = State;
            int oldTop   = LuaCore.GetTop(luaState);

            if (LuaCore.LoadBuffer(luaState, script, 0, ChunkName) == 0)
            {
                if (LuaCore.Call(luaState, 0, -1, 0) == 0)
                {
                    return(ObjectMgr.PopResults(luaState, oldTop));
                }
                ThrowExceptionFromError(luaState, oldTop);
            }
            else
            {
                ThrowExceptionFromError(luaState, oldTop);
            }
            return(null);
        }