예제 #1
0
파일: LuaUtils.cpp 프로젝트: Arkazon/spring
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;
}
예제 #2
0
	~VFTableHook() {
		RestoreTable();
		if (m_bReplace && m_pNewVMTable) delete[] m_pNewVMTable;
	}