741 {
744 string cfg_path =
"cfgVehicles" +
" " +
GetParent().GetType() +
" "+
"Construction" +
" " + main_part_name +
" " + part_name +
" " +
"Materials";
745
746 if (
g_Game.ConfigIsExisting( cfg_path ) )
747 {
748 int child_count =
g_Game.ConfigGetChildrenCount( cfg_path );
749
750 for ( int i = 0; i < child_count; i++ )
751 {
752 string child_name;
753 g_Game.ConfigGetChildName( cfg_path, i, child_name );
754
755
756 string config_path;
757 string type;
758 string slot_name;
759 config_path = cfg_path + " " + child_name + " " + "type";
760 g_Game.ConfigGetText( config_path, type );
761 config_path = cfg_path + " " + child_name + " " + "slot_name";
762 g_Game.ConfigGetText( config_path, slot_name );
763 config_path = cfg_path + " " + child_name + " " + "quantity";
764 float quantity =
g_Game.ConfigGetFloat( config_path );
765 config_path = cfg_path + " " + child_name + " " + "lockable";
766 bool lockable =
g_Game.ConfigGetInt( config_path );
767
768
770
771
772 if ( lockable )
773 {
774 if ( attachment )
775 {
777 attachment.GetInventory().GetCurrentInventoryLocation( inventory_location );
779
780 GetParent().GetInventory().SetSlotLock( inventory_location.
GetSlot() ,
false );
781 g_Game.ObjectDelete( attachment );
782 }
783 }
784 }
785 }
786 }
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
ConstructionPart GetConstructionPart(string part_name)
proto native int GetSlot()
returns slot id if current type is Attachment
static bool IsBaseBuildingLogEnable()