Start energy consumption once code lock is attached with a battery and the lock parent can have a construction component
См. определение в файле CodeLock.c строка 111
112 {
113 super.OnWasAttached(parent, slot_id);
114
116 {
118 string slotName = InventorySlots.GetSlotName(slot_id);
119 if (
slotName.IndexOf(
"Att_CodeLock") > -1)
120 {
122 if (battery && battery.GetCompEM().GetEnergy() > 0 && !GetCompEM().IsWorking())
123 {
125 GetCompEM().SwitchOn();
126 }
127
128 if (parent && parent.CanUseConstruction())
129 {
131 if (buildingBase)
132 {
134 }
135 }
136 }
137
139 }
140 }
PlayerSpawnPreset slotName
void SetDoorInfoFromSlot(BuildingBase buildingBase, string slotName)
ref CodeLockComponent m_CodeLockComponent
Перекрестные ссылки BuildingBase(), g_Game, GetBattery(), InventorySlots::GetSlotName(), m_CodeLockComponent, SetDoorInfoFromSlot(), slotName и UpdateVisuals().