481 {
483 float maxStackSize;
485
487 maxStackSize =
g_Game.ConfigGetInt(
"cfgVehicles " + itemName +
" varStackMax");
488 if( maxStackSize < 1)
489 maxStackSize =
g_Game.ConfigGetInt(
"cfgVehicles " + itemName +
" varQuantityMax");
490 if( maxStackSize < 1)
491 maxStackSize = 1;
492
493 int fullPilesCount =
Math.
Floor(quantity/maxStackSize);
494 int rest = quantity - (fullPilesCount * maxStackSize);
495
496 for (int i = 0; i < fullPilesCount; ++i)
497 {
498 if (floatySpawn)
499 {
501 }
502 else
503 {
505 }
506
508 pile.SetHealth(health);
509
510 if (throwAfterSpawn)
511 {
513 }
514
515 itemPiles.Insert(pile);
516 }
517
518 if (rest > 0)
519 {
520 if (floatySpawn)
521 {
523 }
524 else
525 {
527 }
528
530 pile.SetHealth(health);
531
532 if (throwAfterSpawn)
533 {
535 }
536
537 itemPiles.Insert(pile);
538 }
539
540 return itemPiles;
541 }
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.
static proto float Floor(float f)
Returns floor of value.