DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandleHierarchyRootLock()

void HandleHierarchyRootLock ( bool state)
protected

См. определение в файле CodeLockComponent.c строка 212

213 {
214 if (m_DoorIndex == -1)
215 {
216 #ifdef CODELOCKCOMPONENT_LOG
217 ErrorEx(string.Format("Error! Invalid call of HandleHierarchyRootLock without valid door index! Parent=%1 | Door index=%2", m_Parent, m_DoorIndex), ErrorExSeverity.ERROR);
218 #endif
219 return;
220 }
221
222 Building building = Building.Cast(m_Parent.GetHierarchyRoot());
223 if (!building || !building.CanUseConstruction())
224 {
225 #ifdef CODELOCKCOMPONENT_LOG
226 ErrorEx(string.Format("Error! Invalid hierarchy root parent for lock! Parent=%1 | Hierarchy root parent=%2", m_Parent, m_Parent.GetHierarchyRoot()), ErrorExSeverity.ERROR);
227 #endif
228 return;
229 }
230
231 if (m_DoorIndex > building.GetDoorCount() - 1)
232 {
233 #ifdef CODELOCKCOMPONENT_LOG
234 ErrorEx(string.Format("Warning! Given door index is out of bounds! Door index=%1 | Doors count=%2", m_DoorIndex, building.GetDoorCount()), ErrorExSeverity.ERROR);
235 #endif
236 return;
237 }
238
239 if (state)
240 {
241 building.LockDoor(m_DoorIndex);
242
243 #ifdef CODELOCKCOMPONENT_LOG
244 ErrorEx(string.Format("Locked door! Door index=%1 | Doors count=%2", m_DoorIndex, building.GetDoorCount()), ErrorExSeverity.INFO);
245 #endif
246 }
247 else
248 {
249 building.UnlockDoor(m_DoorIndex);
250
251 #ifdef CODELOCKCOMPONENT_LOG
252 ErrorEx(string.Format("Unlocked door! Door index=%1 | Doors count=%2", m_DoorIndex, building.GetDoorCount()), ErrorExSeverity.INFO);
253 #endif
254 }
255 }
Entity m_Parent
Определения CachedEquipmentStorageBase.c:17
int m_DoorIndex
Определения CodeLockComponent.c:36
proto native void LockDoor(int index, bool force=false)
Locks the door if not already locked, resets the door health. 'force = true' will close the door if o...
proto native int GetDoorCount()
Returns the number of the doors in the building.
proto native void UnlockDoor(int index, bool animate=true)
Unlocks the door if locked, AJAR animation optional.
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx, Building::GetDoorCount(), Building::LockDoor(), m_DoorIndex, m_Parent и Building::UnlockDoor().

Используется в SetLockState().