static bool RestoreData(const LuaUtils::DataDump &d, lua_State* dst, int depth) { const int type = d.type; switch (type) { case LUA_TBOOLEAN: { lua_pushboolean(dst, d.bol); break; } case LUA_TNUMBER: { lua_pushnumber(dst, d.num); break; } case LUA_TSTRING: { lua_pushlstring(dst, d.str.c_str(), d.str.size()); break; } case LUA_TTABLE: { RestoreTable(d, dst, depth); break; } default: { lua_pushnil(dst); break; } } return true; }
~VFTableHook() { RestoreTable(); if (m_bReplace && m_pNewVMTable) delete[] m_pNewVMTable; }