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

◆ CreateMagazinePiles()

static array< Magazine > CreateMagazinePiles ( string item_name,
vector ground_position,
float quantity,
float health )
staticprotected

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

582 {
583 array<Magazine> items;
584 float stack_size;
585 Magazine pile;
586
587 items = new array<Magazine>;
588 stack_size = g_Game.ConfigGetInt("cfgMagazines " + item_name + " count");
589
590 int piles_count = Math.Floor(quantity/stack_size);
591 int rest = quantity - (piles_count*stack_size);
592
593 for (int i = 0; i < piles_count; ++i)
594 {
595 pile = Magazine.Cast(g_Game.CreateObjectEx(item_name, ground_position, ECE_PLACE_ON_SURFACE));
596 pile.ServerSetAmmoCount(stack_size);
597 items.Insert(pile);
598 }
599 if (rest > 0)
600 {
601 pile = Magazine.Cast(g_Game.CreateObjectEx(item_name, ground_position, ECE_PLACE_ON_SURFACE));
602 pile.ServerSetAmmoCount(rest);
603 items.Insert(pile);
604 }
605 return items;
606 }
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:38
DayZGame g_Game
Определения DayZGame.c:4074
Определения EnMath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto float Floor(float f)
Returns floor of value.

Перекрестные ссылки ECE_PLACE_ON_SURFACE, Math::Floor() и g_Game.