613 {
616 float stack_size;
617 Magazine pile;
618 string item_name;
619 if (!
g_Game.ConfigGetText(
"cfgAmmo " + bullet_type +
" spawnPileType", item_name))
620 return items;
621
622 stack_size =
g_Game.ConfigGetInt(
"cfgMagazines " + item_name +
" count");
623
624 if (stack_size > 0)
625 {
626 int piles_count =
Math.
Floor(quantity/stack_size);
627 int rest = quantity - (piles_count*stack_size);
628
629 for (int i = 0; i < piles_count; ++i)
630 {
632 pile.ServerSetAmmoCount(stack_size);
633 items.Insert(pile);
634 }
635
636 if (rest > 0)
637 {
639 pile.ServerSetAmmoCount(rest);
640 items.Insert(pile);
641 }
642 }
643 return items;
644 }
const int ECE_PLACE_ON_SURFACE
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static proto float Floor(float f)
Returns floor of value.