618 {
620 string cfg_path =
"cfgVehicles" +
" " +
GetParent().GetType() +
" "+
"Construction" +
" " + main_part_name +
" " + part_name +
" " +
"Materials";
621
622 if (
g_Game.ConfigIsExisting( cfg_path ) )
623 {
624 int child_count =
g_Game.ConfigGetChildrenCount( cfg_path );
625
626 for ( int i = 0; i < child_count; i++ )
627 {
628 string child_name;
629 g_Game.ConfigGetChildName( cfg_path, i, child_name );
630
631
632 string material_path;
633 string slot_name;
634 float quantity;
635 material_path = cfg_path + " " + child_name + " " + "slot_name";
636 g_Game.ConfigGetText( material_path, slot_name );
637 material_path = cfg_path + " " + child_name + " " + "quantity";
638 quantity =
g_Game.ConfigGetFloat( material_path );
639
640 if (repairing)
641 {
644 }
645
646
648 {
649 return false;
650 }
651 }
652 }
653
654 return true;
655 }
ConstructionPart GetConstructionPart(string part_name)
enum ConstructionMaterialType REPAIR_MATERIAL_PERCENTAGE
bool HasMaterialWithQuantityAttached(string slot_name, float quantity)
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Floor(float f)
Returns floor of value.