creation method using raycast-dispersed positioning; ECE_TRACE not used as a result
517 {
519 float max_stack_size;
521
523 max_stack_size =
g_Game.ConfigGetInt(
"cfgVehicles " + item_name +
" varStackMax");
524 if( max_stack_size < 1)
525 max_stack_size =
g_Game.ConfigGetInt(
"cfgVehicles " + item_name +
" varQuantityMax");
526 if( max_stack_size < 1)
527 max_stack_size = 1;
528
529 int full_piles_count =
Math.
Floor(quantity/max_stack_size);
530 int rest = quantity - (full_piles_count*max_stack_size);
532
533 for (int i = 0; i < full_piles_count; ++i)
534 {
535 randomizedPos = MiscGameplayFunctions.GetRandomizedPositionVerified(starPos,targetPos,radius,ignoreObjectCollison);
538 pile.SetHealth(health);
539 item_piles.Insert(pile);
540 }
541
542 if (rest > 0)
543 {
544 randomizedPos = MiscGameplayFunctions.GetRandomizedPositionVerified(starPos,targetPos,radius,ignoreObjectCollison);
547 pile.SetHealth(health);
548 item_piles.Insert(pile);
549 }
550 return item_piles;
551 }
const int ECE_PLACE_ON_SURFACE
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.