| 45 | } |
| 46 | |
| 47 | void CCustomDetectorSHOC::Load(LPCSTR section) |
| 48 | { |
| 49 | inherited::Load(section); |
| 50 | |
| 51 | m_fRadius = pSettings->r_float(section, "radius"); |
| 52 | |
| 53 | if (pSettings->line_exist(section, "night_vision_particle")) |
| 54 | m_nightvision_particle = pSettings->r_string(section, "night_vision_particle"); |
| 55 | |
| 56 | u32 i = 1; |
| 57 | string256 temp; |
| 58 | |
| 59 | //загрузить звуки для обозначения различных типов зон |
| 60 | do |
| 61 | { |
| 62 | sprintf_s(temp, "zone_class_%d", i); |
| 63 | if (pSettings->line_exist(section, temp)) |
| 64 | { |
| 65 | LPCSTR z_Class = pSettings->r_string(section, temp); |
| 66 | CLASS_ID zone_cls = TEXT2CLSID(pSettings->r_string(z_Class, "class")); |
| 67 | |
| 68 | m_ZoneTypeMap.insert(std::make_pair(zone_cls, ZONE_TYPE_SHOC())); |
| 69 | ZONE_TYPE_SHOC& zone_type = m_ZoneTypeMap[zone_cls]; |
| 70 | sprintf_s(temp, "zone_min_freq_%d", i); |
| 71 | zone_type.min_freq = pSettings->r_float(section, temp); |
| 72 | sprintf_s(temp, "zone_max_freq_%d", i); |
| 73 | zone_type.max_freq = pSettings->r_float(section, temp); |
| 74 | R_ASSERT(zone_type.min_freq < zone_type.max_freq); |
| 75 | sprintf_s(temp, "zone_sound_%d_", i); |
| 76 | |
| 77 | HUD_SOUND::LoadSound(section, temp, zone_type.detect_snds, SOUND_TYPE_ITEM); |
| 78 | |
| 79 | sprintf_s(temp, "zone_map_location_%d", i); |
| 80 | |
| 81 | if (pSettings->line_exist(section, temp)) |
| 82 | zone_type.zone_map_location = pSettings->r_string(section, temp); |
| 83 | |
| 84 | sprintf_s(temp, "zone_radius_%d", i); |
| 85 | zone_type.m_fRadius = READ_IF_EXISTS(pSettings, r_float, section, temp, m_fRadius); |
| 86 | |
| 87 | ++i; |
| 88 | } |
| 89 | else |
| 90 | break; |
| 91 | } while (true); |
| 92 | |
| 93 | m_ef_detector_type = pSettings->r_u32(section, "ef_detector_type"); |
| 94 | m_detect_actor_radiation = READ_IF_EXISTS(pSettings, r_bool, section, "detect_actor_radiation", false); |
| 95 | } |
| 96 | |
| 97 | void CCustomDetectorSHOC::shedule_Update(u32 dt) |
| 98 | { |
nothing calls this directly
no test coverage detected