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

◆ UpdateGlowState()

void PumpkinHelmet::UpdateGlowState ( )
inlineprivate

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

45 {
46 // Makes sure PumpkinHelmet doesn't glow when it's attached on head, or it's inside cargo.
47
48 bool do_glow = true;
49
50 if ( IsDamageDestroyed() )
51 {
52 do_glow = false;
53 }
54 else
55 {
56 int id = InventorySlots.HEADGEAR;
57 InventoryLocation IL = new InventoryLocation();
58 GetInventory().GetCurrentInventoryLocation( IL );
59
60 int id_2 = IL.GetSlot();
61 int id_cargo = IL.GetIdx();
62
63 if ( id == id_2) // Pumpkin is attached on head
64 do_glow = false;
65
66 if ( id_cargo != -1 ) // Pumpkin is in cargo
67 do_glow = false;
68 }
69
70 SetPilotLight(do_glow);
71 }
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo

Перекрестные ссылки InventoryLocation::GetIdx() и InventoryLocation::GetSlot().

Используется в EEHealthLevelChanged(), EOnInit(), OnItemLocationChanged(), OnMovedInsideCargo(), OnMovedWithinCargo() и OnRemovedFromCargo().