DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetAmmoWeightByBulletType()

static float Ammunition_Base::GetAmmoWeightByBulletType ( string bulletType)
inlinestaticprivate

См. определение в файле AmmunitionPiles.c строка 6

7 {
8 if (m_AmmoWeightByBulletType.Contains(bulletType))
9 {
10 return m_AmmoWeightByBulletType.Get(bulletType);
11 }
12 else
13 {
14 float ammoWeight;
15 string ammoTypeName;
16 GetGame().ConfigGetText( string.Format("CfgAmmo %1 spawnPileType", bulletType) , ammoTypeName);
17 if (ammoTypeName)
18 ammoWeight = GetGame().ConfigGetFloat(string.Format("CfgMagazines %1 weight", ammoTypeName));
19 else
20 ErrorEx("empty 'spawnPileType' for bullet type:" + bulletType);
21 if (ammoWeight)
22 m_AmmoWeightByBulletType.Insert(bulletType, ammoWeight);
23 return ammoWeight;
24 }
25 }
static ref map< string, float > m_AmmoWeightByBulletType
Определения AmmunitionPiles.c:4
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native CGame GetGame()
enum ShapeType ErrorEx

Перекрестные ссылки CGame::ConfigGetFloat(), CGame::ConfigGetText(), ErrorEx, GetGame() и m_AmmoWeightByBulletType.

Используется в Weapon::GetWeightSpecialized().