476 {
478 float max_stack_size;
480
482 max_stack_size =
g_Game.ConfigGetInt(
"cfgVehicles " + item_name +
" varStackMax");
483 if( max_stack_size < 1)
484 max_stack_size =
g_Game.ConfigGetInt(
"cfgVehicles " + item_name +
" varQuantityMax");
485 if( max_stack_size < 1)
486 max_stack_size = 1;
487
488 int full_piles_count =
Math.
Floor(quantity/max_stack_size);
489 int rest = quantity - (full_piles_count*max_stack_size);
490
491 for (int i = 0; i < full_piles_count; ++i)
492 {
493 if (floaty_spawn)
495 else
498 pile.SetHealth(health);
499 item_piles.Insert(pile);
500 }
501
502 if (rest > 0)
503 {
504 if (floaty_spawn)
506 else
509 pile.SetHealth(health);
510 item_piles.Insert(pile);
511 }
512 return item_piles;
513 }
const int ECE_PLACE_ON_SURFACE
const int ECE_UPDATEPATHGRAPH
const int ECE_CREATEPHYSICS
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static proto float Floor(float f)
Returns floor of value.