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

◆ SortAmmo()

void ActionSortAmmoPile::SortAmmo ( ItemBase item)
inlineprivate

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

36 {
37 Magazine magazine;
38 Magazine piles[5];
39 //string pile_classname = magazine.ConfigGetString("spawnPileType");
40 if( Class.CastTo(magazine, item) )
41 {
42 float health;
43 string ammo_type;
44 while( magazine.GetAmmoCount() > 0)
45 {
46 int count = magazine.GetAmmoCount();
47 if(magazine.ServerAcquireCartridge(health, ammo_type))
48 {
49 int health_label = MiscGameplayFunctions.GetHealthLevelForAmmo(ammo_type,health);
50 if( piles[health_label] == null )
51 {
52 piles[health_label] = Magazine.Cast( GetGame().CreateObjectEx( item.ClassName(), item.GetPosition(), ECE_PLACE_ON_SURFACE ) );
53 }
54 piles[health_label].ServerStoreCartridge(health,ammo_type);
55 }
56 }
57 }
58 }
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
proto native CGame GetGame()

Перекрестные ссылки Class::CastTo(), ECE_PLACE_ON_SURFACE и GetGame().

Используется в OnEndAnimationLoopServer().