554 {
556 float stack_size;
557 Magazine pile;
558
560 stack_size =
g_Game.ConfigGetInt(
"cfgMagazines " + item_name +
" count");
561
562 int piles_count =
Math.
Floor(quantity/stack_size);
563 int rest = quantity - (piles_count*stack_size);
564
565 for (int i = 0; i < piles_count; ++i)
566 {
568 pile.ServerSetAmmoCount(stack_size);
569 items.Insert(pile);
570 }
571 if (rest > 0)
572 {
574 pile.ServerSetAmmoCount(rest);
575 items.Insert(pile);
576 }
577 return items;
578 }
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.