void st_LevelOptions::Read(IReader& F) { R_ASSERT(F.find_chunk(CHUNK_LO_VERSION)); DWORD vers = F.r_u32( ); if( vers < 0x00000008 ) { ELog.DlgMsg( mtError, "Skipping bad version of level options." ); return; } R_ASSERT(F.find_chunk(CHUNK_LO_NAMES)); F.r_stringZ (m_FNLevelPath); if (F.find_chunk(CHUNK_LO_PREFIX)) F.r_stringZ (m_LevelPrefix); R_ASSERT(F.find_chunk(CHUNK_LO_BOP)); F.r_stringZ (m_BOPText); if (F.find_chunk(CHUNK_LO_MAP_VER)) F.r_stringZ (m_map_version); vers = 0; if (F.find_chunk(CHUNK_LO_BP_VERSION)) vers = F.r_u32( ); if (CURRENT_LEVELOP_BP_VERSION==vers){ if (F.find_chunk(CHUNK_BUILD_PARAMS)) F.r(&m_BuildParams, sizeof(m_BuildParams)); }else{ ELog.DlgMsg (mtError, "Skipping bad version of build params."); m_BuildParams.Init(); } if (F.find_chunk(CHUNK_LIGHT_QUALITY)) { m_LightHemiQuality = F.r_u8(); m_LightSunQuality = F.r_u8(); } if (F.find_chunk(CHUNK_MAP_USAGE)) { if(vers > 0x00000008) { m_mapUsage.m_GameType.assign (F.r_u16()); }else { m_mapUsage.m_GameType.zero (); m_mapUsage.m_GameType.set (eGameIDDeathmatch , F.r_s32()); m_mapUsage.m_GameType.set (eGameIDTeamDeathmatch, F.r_s32()); m_mapUsage.m_GameType.set (eGameIDArtefactHunt, F.r_s32()); } } }
void CPhantom::load(IReader &input_packet) { SwitchToState (EState(input_packet.r_s32())); }