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

◆ CheckAmmoCompability()

static bool CGame::CheckAmmoCompability ( EntityAI weaponInHand,
EntityAI ammo )
inlinestaticprotected

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

3717 {
3718 TStringArray ammo_names = new TStringArray; // Array of ammo types (their name) that can be used with weapon in hand
3719
3720 string cfg_path = "CfgWeapons " + weaponInHand.GetType() + " chamberableFrom"; // Create config path
3721 GetGame().ConfigGetTextArray(cfg_path, ammo_names); // Get ammo types
3722
3723 foreach (string ammo_name : ammo_names) // for every ammo in ammo string compare passed ammo
3724 {
3725 if (ammo.GetType() == ammo_name)
3726 {
3727 return true;
3728 }
3729 }
3730
3731 // if no ammo from the array matches with ammo passed, return false
3732 return false;
3733 }
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native CGame GetGame()
array< string > TStringArray
Определения EnScript.c:685

Перекрестные ссылки ConfigGetTextArray() и GetGame().