672 {
674 string cfg_path =
"cfgVehicles" +
" " +
GetParent().GetType() +
" "+
"Construction" +
" " + main_part_name +
" " + part_name +
" " +
"Materials";
675
676 if (
GetGame().ConfigIsExisting( cfg_path ) )
677 {
679
680 for ( int i = 0; i < child_count; i++ )
681 {
682 string child_name;
684
685
686 string config_path;
687 string slot_name;
688 config_path = cfg_path + " " + child_name + " " + "slot_name";
690 config_path = cfg_path + " " + child_name + " " + "quantity";
692 config_path = cfg_path + " " + child_name + " " + "lockable";
694
696 if ( lockable )
697 {
698
700 attachment.GetInventory().GetCurrentInventoryLocation( inventory_location );
701
702 GetParent().GetInventory().SetSlotLock( inventory_location.
GetSlot(),
true );
703 }
704 else
705 {
706 if ( quantity > -1 )
707 {
708 if (repairing)
709 {
712 }
713
714 attachment.AddQuantity( -quantity );
715 }
716 else
717 {
719 }
720 }
721 }
722 }
723 }
ConstructionPart GetConstructionPart(string part_name)
enum ConstructionMaterialType REPAIR_MATERIAL_PERCENTAGE
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native void ObjectDelete(Object obj)
proto native int GetSlot()
returns slot id if current type is Attachment
proto native CGame GetGame()
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Floor(float f)
Returns floor of value.