MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / SaveAttachableParams

Method SaveAttachableParams

ogsr_engine/xrGame/Weapon.cpp:2147–2175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2145bool CWeapon::IsPartlyReloading() const { return (ef_weapon_type() == 10 || m_set_next_ammoType_on_reload == u32(-1)) && GetAmmoElapsed() > 0 && !IsMisfire(); }
2146
2147void CWeapon::SaveAttachableParams()
2148{
2149 const char* sect_name = cNameSect().c_str();
2150 string_path buff;
2151 FS.update_path(buff, "$logs$", make_string("_world\\%s.ltx", sect_name).c_str());
2152
2153 CInifile pHudCfg(buff, FALSE, FALSE, TRUE);
2154
2155 sprintf_s(buff, "%f,%f,%f", m_Offset.c.x, m_Offset.c.y, m_Offset.c.z);
2156 pHudCfg.w_string(sect_name, "position", buff);
2157
2158 Fvector ypr;
2159 m_Offset.getHPB(ypr.x, ypr.y, ypr.z);
2160 ypr.mul(180.f / PI);
2161 sprintf_s(buff, "%f,%f,%f", ypr.x, ypr.y, ypr.z);
2162 pHudCfg.w_string(sect_name, "orientation", buff);
2163
2164 if (pSettings->line_exist(sect_name, "strap_position") && pSettings->line_exist(sect_name, "strap_orientation"))
2165 {
2166 sprintf_s(buff, "%f,%f,%f", m_StrapOffset.c.x, m_StrapOffset.c.y, m_StrapOffset.c.z);
2167 pHudCfg.w_string(sect_name, "strap_position", buff);
2168 m_StrapOffset.getHPB(ypr.x, ypr.y, ypr.z);
2169 ypr.mul(180.f / PI);
2170 sprintf_s(buff, "%f,%f,%f", ypr.x, ypr.y, ypr.z);
2171 pHudCfg.w_string(sect_name, "strap_orientation", buff);
2172 }
2173
2174 Msg("--[%s] data saved to [%s]", __FUNCTION__, pHudCfg.fname());
2175}
2176
2177void CWeapon::UpdateVisualBullets()
2178{

Callers

nothing calls this directly

Calls 8

make_stringFunction · 0.85
MsgFunction · 0.85
w_stringMethod · 0.80
getHPBMethod · 0.80
line_existMethod · 0.80
c_strMethod · 0.45
update_pathMethod · 0.45
mulMethod · 0.45

Tested by

no test coverage detected