641 {
644 float stack_size;
645 Magazine pile;
646 string item_name;
647 if (!
g_Game.ConfigGetText(
"cfgAmmo " + bullet_type +
" spawnPileType", item_name))
648 return items;
649
650 stack_size =
g_Game.ConfigGetInt(
"cfgMagazines " + item_name +
" count");
651
652 if (stack_size > 0)
653 {
654 int piles_count =
Math.
Floor(quantity/stack_size);
655 int rest = quantity - (piles_count*stack_size);
656
657 for (int i = 0; i < piles_count; ++i)
658 {
660 pile.ServerSetAmmoCount(stack_size);
661 items.Insert(pile);
662 }
663
664 if (rest > 0)
665 {
667 pile.ServerSetAmmoCount(rest);
668 items.Insert(pile);
669 }
670 }
671 return items;
672 }
const int ECE_PLACE_ON_SURFACE
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto float Floor(float f)
Returns floor of value.